This is the mail archive of the
mailing list for the GCC project.
[PATCH, rs6000] Fix PR61542 - V4SF vector extract for little endian
- 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: Tue, 17 Jun 2014 17:44:44 -0500
- Subject: [PATCH, rs6000] Fix PR61542 - V4SF vector extract for little endian
- Authentication-results: sourceware.org; auth=none
As described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61542, a
new test case (gcc.dg/vect/vect-nop-move.c) was added in 4.9. This
exposes a bug on PowerPC little endian for extracting an element from a
V4SF value that goes back to 4.8. The following patch fixes the
Tested on powerpc64le-unknown-linux-gnu with no regressions. Ok to
commit to trunk? I would also like to commit to 4.8 and 4.9 as soon as
possible to be picked up by the distros.
I would also like to backport gcc.dg/vect/vect-nop-move.c to 4.8 to
provide regression coverage.
2014-06-17 Bill Schmidt <email@example.com>
* config/rs6000/vsx.md (vsx_extract_v4sf): Fix bug with element
extraction other than index 3.
--- gcc/config/rs6000/vsx.md (revision 211741)
+++ gcc/config/rs6000/vsx.md (working copy)
@@ -1667,7 +1667,7 @@
if (GET_CODE (op3) == SCRATCH)
op3 = gen_reg_rtx (V4SFmode);
- emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, op2));
+ emit_insn (gen_vsx_xxsldwi_v4sf (op3, op1, op1, GEN_INT (ele)));
tmp = op3;
emit_insn (gen_vsx_xscvspdp_scalar2 (op0, tmp));