Skip to content

[AArch64] Missed FCCMP opportunity #60819

@SamTebbs33

Description

@SamTebbs33

The code

bool foo2 (float a, float b)
{
  return __builtin_isnan (a) && __builtin_isnan (b);
}

with LLVM -O2 produces

foo2(float, float):                              // @foo2(float, float)
        fcmp    s0, s0
        cset    w8, vs
        fcmp    s1, s1
        cset    w9, vs
        and     w0, w8, w9
        ret

but GCC can produce:

foo2(float, float):
        fcmp    s1, s1
        fccmp   s0, s0, 0, vs
        cset    w0, vs
        ret

https://godbolt.org/z/e58hM4Pdq

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