Skip to content

[AArch64][GlobalISel] Improve i128 mul generation #115512

@davemgreen

Description

@davemgreen

i128 multiplies under GlobalISel could be producing more madds if it reassociated the add.
https://godbolt.org/z/Wr1r5ez1G

SDAG

        umulh   x8, x0, x2
        madd    x8, x0, x3, x8
        mul     x0, x0, x2
        madd    x1, x1, x2, x8
        ret

GISel

        mul     x9, x0, x3
        mul     x8, x0, x2
        umulh   x10, x0, x2
        madd    x9, x1, x2, x9
        mov     x0, x8
        add     x1, x9, x10
        ret

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions