This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, rs6000] More vector LE cleanups
- From: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dje dot gcc at gmail dot com
- Date: Thu, 21 Nov 2013 18:27:27 -0600
- Subject: [PATCH, rs6000] More vector LE cleanups
- Authentication-results: sourceware.org; auth=none
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.
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);