On Thu, Jun 30, 2016 at 08:10:41PM -0400, Michael Meissner wrote: > Aaron Sawdey was running tests on the Power9 simulator, and he noticed that > the > XXSPLTW to splat the SFmode value into the vector accessed the wrong element. > When I added the more general code for vector splat for power9, I called an > insn that reversed the element numbers on little endian, when I should have > called the direct function, since the XSCVDPSPN instruction leaves the > converted value in real element 0 in the hardware.
The changelog could be clearer (I first thought you attached the wrong patch :-) ) Instead of "use vsx_xxspltw_v4sf_direct" you could say e.g. "emit code matching use vsx_xxspltw_v4sf_direct,". Okay for trunk with the comment clarified, and for 6 later. Segher > * config/rs6000/vsx.md (vsx_splat_v4sf_internal): When splitting > the insns, use vsx_xxspltw_v4sf_direct which does not check for > little endian. > Index: gcc/config/rs6000/vsx.md > =================================================================== > --- gcc/config/rs6000/vsx.md (revision 237895) > +++ gcc/config/rs6000/vsx.md (working copy) > @@ -2512,9 +2512,8 @@ (define_insn_and_split "*vsx_splat_v4sf_ > [(set (match_dup 0) > (unspec:V4SF [(match_dup 1)] UNSPEC_VSX_CVDPSPN)) > (set (match_dup 0) > - (vec_duplicate:V4SF > - (vec_select:SF (match_dup 0) > - (parallel [(const_int 0)]))))] > + (unspec:V4SF [(match_dup 0) > + (const_int 0)] UNSPEC_VSX_XXSPLTW))] > "" > [(set_attr "type" "vecload,vecperm,mftgpr") > (set_attr "length" "4,8,4")])