On Fri, Mar 11, 2011 at 1:34 PM, Peter Bergner <berg...@vnet.ibm.com> wrote: > This patch fixes the two related bugs in PR48053. The problem here deals > with loading constants into VSX registers. The first bug occurs when we > try and load up a full constant into the VSX register. We end up calling > easy_vector_constant_msb which is supported only for V4SI and V4SF modes. > The fix here was to modify the easy_vector_constant_msb predicate to > reject V2DI and V2DF modes. > > The second bug was when we attempt to load a VSX register with a constant > for one half of the register and a variable for the other half. This > caused an ICE in int_mode_for_mode. I fixed this by first forcing the > correct scalar mode in rs6000_expand_vector_init() and then adding > special support in the movdi_internal* patterns to allow setting of > VSX registers to zero. > > These fixed both test cases in PR48053 and Pat Haugen verified that > they fixed the SPEC benchmarks the test cases were reduced from, > without introducing any new SPEC regressions. > > This patch passed bootstrapp and regtesting on powerpc64-linux > (test suite run in both 32-bit and 64-bit modes). Ok for mainline? > > Peter > > > gcc/ > PR target/48053 > * config/rs6000/predicates.md (easy_vector_constant_add_self, > easy_vector_constant_msb): Do not handle V2DImode and V2DFmode. > * config/rs6000/rs6000.c (const_vector_elt_as_int): Add assert that > mode is not V2DImode or V2DFmode. > (vspltis_constant): Do not handle V2DImode and V2DFmode. > (rs6000_expand_vector_init): Replace copy_to_reg with copy_to_mode_reg. > * config/rs6000/rs6000.md (movdi_internal32): Allow setting VSX > registers to 0. > (movdi_internal64): Likewise. > > gcc/testsuite/ > PR target/48053 > * gcc/testsuite/gcc.target/powerpc/pr48053-1.c: New test. > * gcc/testsuite/gcc.target/powerpc/pr48053-2.c: Likewise.
Okay. Thanks, David