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

            Bug ID: 125193
           Summary: z13: vec_splats for BFP constant often cause load
           Product: gcc
           Version: 15.1.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: ---

gcc already uses vgm to generate special floating point values e.g.
vec_splats((double)INFINITY). That is great.
The same approach could be used for a wide range of floating point numbers e.g.
0.5,1.0,1.5,...

combine with VECTOR FP PERFORM SIGN
OPERATION this can be extended to
-0.5,-1.0,-1.5

All floating point numbers which have a signed 16-bit integer equivalent can be
constructed like this:

vector double vm10_2()
{
    return vec_double(vec_splats(-10LL));
}

v10_opt():
        vrepi   %v24,10,3
        vcdgb   %v24,%v24,0,0
        br      %r14

=> a wide range of values can be constructed using 1-2 instructions.

This is faster than a load + replicate that gets created today.
        larl    %r5,.L4
        vlrepg  %v24,.L5-.L4(%r5)

Reply via email to