Message ID | 1385080047.30314.13.camel@gnopaine |
---|---|
State | New |
Headers | show |
On Thu, Nov 21, 2013 at 7:27 PM, Bill Schmidt <wschmidt@linux.vnet.ibm.com> wrote: > Hi, > > This patch fixes two issues to allow correct compilation of > gcc.dg/torture/vec-cvt-1.c in little endian mode. The first reverts a > change in three patterns in vector.md. This is from an early patch that > preceded the general fix for vector permutes. As a consequence we ended > up swapping the input arguments twice. So we can simplify the code here > and have it operate the same for big and little endian. > > The other issue corrects a scenario where I managed to check for > endianness twice, with the effect that the code acts the same for both > big and little endian when it shouldn't. > > Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no > regressions. Is this ok for trunk? > > Thanks, > Bill > > > 2013-11-21 Bill Schmidt <wschmidt@vnet.ibm.com> > > * config/rs6000/vector.md (vec_pack_trunc_v2df): Revert previous > little endian change. > (vec_pack_sfix_trunc_v2df): Likewise. > (vec_pack_ufix_trunc_v2df): Likewise. > * config/rs6000/rs6000.c (rs6000_expand_interleave): Correct > double checking of endianness. Okay. Thanks, David
Index: gcc/config/rs6000/vector.md =================================================================== --- gcc/config/rs6000/vector.md (revision 205145) +++ gcc/config/rs6000/vector.md (working copy) @@ -831,12 +831,7 @@ emit_insn (gen_vsx_xvcvdpsp (r1, operands[1])); emit_insn (gen_vsx_xvcvdpsp (r2, operands[2])); - - if (BYTES_BIG_ENDIAN) - rs6000_expand_extract_even (operands[0], r1, r2); - else - rs6000_expand_extract_even (operands[0], r2, r1); - + rs6000_expand_extract_even (operands[0], r1, r2); DONE; }) @@ -851,12 +846,7 @@ emit_insn (gen_vsx_xvcvdpsxws (r1, operands[1])); emit_insn (gen_vsx_xvcvdpsxws (r2, operands[2])); - - if (BYTES_BIG_ENDIAN) - rs6000_expand_extract_even (operands[0], r1, r2); - else - rs6000_expand_extract_even (operands[0], r2, r1); - + rs6000_expand_extract_even (operands[0], r1, r2); DONE; }) @@ -871,12 +861,7 @@ emit_insn (gen_vsx_xvcvdpuxws (r1, operands[1])); emit_insn (gen_vsx_xvcvdpuxws (r2, operands[2])); - - if (BYTES_BIG_ENDIAN) - rs6000_expand_extract_even (operands[0], r1, r2); - else - rs6000_expand_extract_even (operands[0], r2, r1); - + rs6000_expand_extract_even (operands[0], r1, r2); DONE; }) Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 205145) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -30116,7 +30116,7 @@ rs6000_expand_interleave (rtx target, rtx op0, rtx unsigned i, high, nelt = GET_MODE_NUNITS (vmode); rtx perm[16]; - high = (highp == BYTES_BIG_ENDIAN ? 0 : nelt / 2); + high = (highp ? 0 : nelt / 2); for (i = 0; i < nelt / 2; i++) { perm[i * 2] = GEN_INT (i + high);