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

            Bug ID: 82636
           Summary: powerpc: Unnecessary copy of __ieee128 parameter
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tuliom at linux dot vnet.ibm.com
  Target Milestone: ---

Tested with GCC 7.2.1 on powerpc64le.

The copy of vs36 (v4) to vs32 (v0) shouldn't be required, i.e. I'd expect to
have xsmaddqp v4,v2,v3.

$ cat s_fmaf128-power9.c
__ieee128
__fmaf128_power9 (__ieee128 x, __ieee128 y, __ieee128 z)
{
  asm ("xsmaddqp\t%0, %1, %2" : "+v" (z) : "v" (x), "v" (y));
  return z;
}

$ gcc -mcpu=power9 -mfloat128 -O3 -c s_fmaf128-power9.c -o test.o

$ objdump -d test.o
...
0000000000000000 <__fmaf128_power9>:
   0:   97 24 04 f0     xxlor   vs32,vs36,vs36    <----
   4:   08 1b 02 fc     xsmaddqp v0,v2,v3
   8:   97 04 40 f0     xxlor   vs34,vs32,vs32
   c:   20 00 80 4e     blr
        ...

Reply via email to