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

            Bug ID: 87870
           Summary: ppc64le generates poor code when loading constants
                    into TImode vars
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

bergner@pike:~/gcc/BUGS/PR87507$ cat bug.i 
__int128
foo (void)
{
  return 1;
}
bergner@pike:~/gcc/BUGS/PR87507$
/home/bergner/gcc/build/gcc-fsf-mainline-pr87507-base-debug/gcc/xgcc
-B/home/bergner/gcc/build/gcc-fsf-mainline-pr87507-base-debug/gcc -O2 -S bug.i 
bergner@pike:~/gcc/BUGS/PR87507$ cat bug.s 
foo:
.LCF0:
0:      addis 2,12,.TOC.-.LCF0@ha
        addi 2,2,.TOC.-.LCF0@l
        addis 9,2,.LC0@toc@ha
        addi 9,9,.LC0@toc@l
        ld 3,0(9)
        ld 4,8(9)
        blr

If you compile with -mno-altivec, then we get the two li insn code you'd
expect.  The problem is that vsx_mov<mode>_64 doesn't have support for loading
constants into gprs, whereas movti_ppc64 (which is used when not targeting a
cpu with a vector unit) does.

Reply via email to