Skip to content

[AArch64] Use umin for x != 0 when +cssc is enabled #161584

@Kmeakin

Description

@Kmeakin

https://godbolt.org/z/Mdr63hKcT

auto src(unsigned long x0) { return x0 != 0; }
auto tgt(unsigned long x0) { asm("umin x0, x0, #1"); }
src(unsigned long):
        cmp     x0, #0
        cset    w0, ne
        ret

tgt(unsigned long):
        umin    x0, x0, #1
        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