On Sat, Nov 2, 2013 at 7:44 PM, Bill Schmidt <wschm...@linux.vnet.ibm.com> wrote: > Hi, > > When I created the patch to split VSX loads and stores to add permutes > so the register image was correctly little endian, I forgot to implement > a known requirement. When a VSX store is split after reload, we must > reuse the source register for the permute, which leaves it in a swapped > state after the store. If the register remains live, this is invalid. > After the store, we need to permute the register back to its original > value. > > For each of the little endian VSX store patterns, I've replaced the > define_insn_and_split with a define_insn and two define_splits, one for > prior to reload and one for after reload. The post-reload split has the > extra behavior. > > I don't know of a way to set the insn's length attribute conditionally, > so I'm optimistically setting this to 8, though it will be 12 in the > post-reload case. Is there any concern with that? Is there a way to > make it fully accurate? > > Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no > regressions. This fixes two failing test cases. Is this ok for trunk? > > Thanks! > Bill > > > 2013-11-02 Bill Schmidt <wschm...@linux.vnet.ibm.com> > > * config/rs6000/vsx.md (*vsx_le_perm_store_<mode> for VSX_D): > Replace the define_insn_and_split with a define_insn and two > define_splits, with the split after reload re-permuting the source > register to its original value. > (*vsx_le_perm_store_<mode> for VSX_W): Likewise. > (*vsx_le_perm_store_v8hi): Likewise. > (*vsx_le_perm_store_v16qi): Likewise.
This is okay, but you must change the insn length to the conservative, larger value. insn length is used to reverse branches when the displacement is too large. Thanks, David