Message ID | 1330703856.29904.3.camel@otta |
---|---|
State | New |
Headers | show |
On Fri, Mar 2, 2012 at 10:57 AM, Peter Bergner <bergner@vnet.ibm.com> wrote: > The patch below fixes a typo in the vsx_set_<mode> pattern that causes > wrong code to be generated when using -mcpu=power7. This passed bootstrap > and regression testing on trunk using powerpc64-linux. Ok for trunk? > > This is also broken on the 4.7, 4.6 and 4.5 branches, is this ok for > those release branches once the branches are open for fixes and my > bootstrapping/regtesting are complete? > > Peter > > * gcc/config/rs6000/vsx.md (vsx_set_<mode>): Reorder operands. > * gcc/testsuite/gcc.target/powerpc/pr52457.c: New test. Okay everywhere, but please make sure that Richi and Jakub are okay with the patch for GCC 4.7. Thanks, David
On Fri, Mar 02, 2012 at 11:19:15AM -0500, David Edelsohn wrote: > On Fri, Mar 2, 2012 at 10:57 AM, Peter Bergner <bergner@vnet.ibm.com> wrote: > > The patch below fixes a typo in the vsx_set_<mode> pattern that causes > > wrong code to be generated when using -mcpu=power7. This passed bootstrap > > and regression testing on trunk using powerpc64-linux. Ok for trunk? > > > > This is also broken on the 4.7, 4.6 and 4.5 branches, is this ok for > > those release branches once the branches are open for fixes and my > > bootstrapping/regtesting are complete? > > > > Peter > > > > * gcc/config/rs6000/vsx.md (vsx_set_<mode>): Reorder operands. > > * gcc/testsuite/gcc.target/powerpc/pr52457.c: New test. > > Okay everywhere, but please make sure that Richi and Jakub are okay > with the patch for GCC 4.7. This is ok for 4.7.0. Jakub
On Fri, 2012-03-02 at 11:19 -0500, David Edelsohn wrote: > On Fri, Mar 2, 2012 at 10:57 AM, Peter Bergner <bergner@vnet.ibm.com> wrote: > > The patch below fixes a typo in the vsx_set_<mode> pattern that causes > > wrong code to be generated when using -mcpu=power7. This passed bootstrap > > and regression testing on trunk using powerpc64-linux. Ok for trunk? > > > > This is also broken on the 4.7, 4.6 and 4.5 branches, is this ok for > > those release branches once the branches are open for fixes and my > > bootstrapping/regtesting are complete? > > > > * gcc/config/rs6000/vsx.md (vsx_set_<mode>): Reorder operands. > > * gcc/testsuite/gcc.target/powerpc/pr52457.c: New test. > > Okay everywhere, but please make sure that Richi and Jakub are okay > with the patch for GCC 4.7. Ok, I have committed the patch to trunk and the 4.7 branch given Jakub's ok in his email. I'll commit the patch to the 4.6 and 4.5 branches once my testing has completed. Thanks. Peter
Index: gcc/config/rs6000/vsx.md =================================================================== --- gcc/config/rs6000/vsx.md (revision 184791) +++ gcc/config/rs6000/vsx.md (working copy) @@ -1119,9 +1119,9 @@ (define_insn "vsx_set_<mode>" "VECTOR_MEM_VSX_P (<MODE>mode)" { if (INTVAL (operands[3]) == 0) - return \"xxpermdi %x0,%x1,%x2,1\"; + return \"xxpermdi %x0,%x2,%x1,1\"; else if (INTVAL (operands[3]) == 1) - return \"xxpermdi %x0,%x2,%x1,0\"; + return \"xxpermdi %x0,%x1,%x2,0\"; else gcc_unreachable (); } Index: gcc/testsuite/gcc.target/powerpc/pr52457.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr52457.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/pr52457.c (revision 0) @@ -0,0 +1,34 @@ +/* { dg-do run { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target vsx_hw } */ +/* { dg-options "-O1 -mcpu=power7" } */ + +extern void abort (void); + +typedef long long T; +typedef T vl_t __attribute__((vector_size(2 * sizeof (T)))); + +vl_t +buggy_func (T x) +{ + vl_t w; + T *p = (T *)&w; + p[0] = p[1] = x; + return w; +} + +int +main(void) +{ + vl_t rval; + T *pl; + + pl = (T *) &rval; + rval = buggy_func (2); + + if (pl[0] != 2 || pl[1] != 2) + abort (); + + return 0; +}