https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103336

            Bug ID: 103336
           Summary: [arm64] operations on long double generate calls to
                    libgcc
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sebpop at gmail dot com
  Target Milestone: ---

On testsuite/gcc.target/i386/long-double-64-1.c, gcc produces a call to
__multf3 on arm64 and the test checks that such a call is not generated on
x86_64.

$ cat a.c
long double
foo (long double x)
{
  return x * x;
}

On arm64:
$  gcc -O2 -S -o- a.c
foo:
        stp     x29, x30, [sp, -16]!
        mov     v1.16b, v0.16b
        mov     x29, sp
        bl      __multf3
        ldp     x29, x30, [sp], 16
        ret

On x64:
$ gcc -O2 -S -o- a.c 
foo:
        endbr64
        fldt    8(%rsp)
        fmul    %st(0), %st
        ret

Why GCC does not generate an fmul on arm64 instead of calling libgcc?

There is a related performance issue in libGeos:
https://github.com/libgeos/geos/issues/509

Reply via email to