[Bug target/93128] New: PPC small floating point constants can be constructed using vector operations

jens.seifert at de dot ibm.com gcc-bugzilla@gcc.gnu.org
Thu Jan 2 09:04:00 GMT 2020


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

            Bug ID: 93128
           Summary: PPC small floating point constants can be constructed
                    using vector operations
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jens.seifert at de dot ibm.com
  Target Milestone: ---

Input:
#include <altivec.h>
double d2()
{
  return 2.0;
}

vector double v2()
{
   return vec_splats(2.0);
}

gcc -O2 -maix64 -mcpu=power7 -maltivec const.C

gcc uses load from constant area.

Better alternative for "integer" values -15.0..+16.0.
        vspltisw 0,<integer value>
        xvcvsxwdp 1,32

0.0 already get constructed using xxlxor, which is great.

Similar things can be done for 
vector float v2f()
{
   return vec_splats(2.0f);
}


More information about the Gcc-bugs mailing list