From 54c4bfd767a22d20d9b6bb0e8678e5c8650ecd67 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Mon, 17 Feb 2014 02:00:26 +0000 Subject: [PATCH] vsx.md (vsx_xxpermdi_): Handle little endian targets. 2014-02-16 Bill Schmidt * config/rs6000/vsx.md (vsx_xxpermdi_): Handle little endian targets. From-SVN: r207814 --- gcc/ChangeLog | 5 +++++ gcc/config/rs6000/vsx.md | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b857c1106b1..1a3acf0e1f2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-02-16 Bill Schmidt + + * config/rs6000/vsx.md (vsx_xxpermdi_): Handle little + endian targets. + 2014-02-15 Michael Meissner PR target/60203 diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index d0fc8cb7c9b..d7450a4bf9e 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -1621,7 +1621,18 @@ op1 = gen_lowpart (V2DImode, op1); } } - emit_insn (gen (target, op0, op1, perm0, perm1)); + /* In little endian mode, vsx_xxpermdi2__1 will perform a + transformation we don't want; it is necessary for + rs6000_expand_vec_perm_const_1 but not for this use. So we + prepare for that by reversing the transformation here. */ + if (BYTES_BIG_ENDIAN) + emit_insn (gen (target, op0, op1, perm0, perm1)); + else + { + rtx p0 = GEN_INT (3 - INTVAL (perm1)); + rtx p1 = GEN_INT (3 - INTVAL (perm0)); + emit_insn (gen (target, op1, op0, p0, p1)); + } DONE; })