re PR target/84226 (ICE in simplify_const_unary_operation, at simplify-rtx.c:1974...
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 9 Feb 2018 18:19:08 +0000 (19:19 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 9 Feb 2018 18:19:08 +0000 (19:19 +0100)
PR target/84226
* config/rs6000/vsx.md (p9_xxbrq_v16qi): Change input operand
constraint from =wa to wa.  Avoid a subreg on the output operand,
instead use a pseudo and subreg it in a move.
(p9_xxbrd_<mode>): Changed to ...
(p9_xxbrd_v2di): ... this insn, without VSX_D iterator.
(p9_xxbrd_v2df): New expander.
(p9_xxbrw_<mode>): Changed to ...
(p9_xxbrw_v4si): ... this insn, without VSX_W iterator.
(p9_xxbrw_v4sf): New expander.

* gcc.target/powerpc/pr84226.c: New test.

From-SVN: r257536

gcc/ChangeLog
gcc/config/rs6000/vsx.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr84226.c [new file with mode: 0644]

index 7f1985894767c1f32e3ded81b63b49ff11101692..4ac7fff372a918e646c3df7c63d5d734983c218b 100644 (file)
@@ -1,7 +1,20 @@
+2018-02-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/84226
+       * config/rs6000/vsx.md (p9_xxbrq_v16qi): Change input operand
+       constraint from =wa to wa.  Avoid a subreg on the output operand,
+       instead use a pseudo and subreg it in a move.
+       (p9_xxbrd_<mode>): Changed to ...
+       (p9_xxbrd_v2di): ... this insn, without VSX_D iterator.
+       (p9_xxbrd_v2df): New expander.
+       (p9_xxbrw_<mode>): Changed to ...
+       (p9_xxbrw_v4si): ... this insn, without VSX_W iterator.
+       (p9_xxbrw_v4sf): New expander.
+
 2018-02-09  Sebastian Perta  <sebastian.perta@renesas.com>
 
-       *config/rx.md: updated "movsicc" expand to be matched by GCC
-       *testsuite/gcc.target/rx/movsicc.c: new test case
+       * config/rx.md: updated "movsicc" expand to be matched by GCC
+       * testsuite/gcc.target/rx/movsicc.c: new test case
 
 2018-02-09  Peter Bergner  <bergner@vnet.ibm.com>
 
index 86efdced2a8cbe5606516d0713202a6eac1dded2..6f0bd09e9bb257bc70b2209aca385c9640e55286 100644 (file)
 
 (define_expand "p9_xxbrq_v16qi"
   [(use (match_operand:V16QI 0 "vsx_register_operand" "=wa"))
-   (use (match_operand:V16QI 1 "vsx_register_operand" "=wa"))]
+   (use (match_operand:V16QI 1 "vsx_register_operand" "wa"))]
   "TARGET_P9_VECTOR"
 {
-  rtx op0 = gen_lowpart (V1TImode, operands[0]);
+  rtx op0 = gen_reg_rtx (V1TImode);
   rtx op1 = gen_lowpart (V1TImode, operands[1]);
   emit_insn (gen_p9_xxbrq_v1ti (op0, op1));
+  emit_move_insn (operands[0], gen_lowpart (V16QImode, op0));
   DONE;
 })
 
 ;; Swap all bytes in each 64-bit element
-(define_insn "p9_xxbrd_<mode>"
-  [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wa")
-       (bswap:VSX_D (match_operand:VSX_D 1 "vsx_register_operand" "wa")))]
+(define_insn "p9_xxbrd_v2di"
+  [(set (match_operand:V2DI 0 "vsx_register_operand" "=wa")
+       (bswap:V2DI (match_operand:V2DI 1 "vsx_register_operand" "wa")))]
   "TARGET_P9_VECTOR"
   "xxbrd %x0,%x1"
   [(set_attr "type" "vecperm")])
 
+(define_expand "p9_xxbrd_v2df"
+  [(use (match_operand:V2DF 0 "vsx_register_operand" "=wa"))
+   (use (match_operand:V2DF 1 "vsx_register_operand" "wa"))]
+  "TARGET_P9_VECTOR"
+{
+  rtx op0 = gen_reg_rtx (V2DImode);
+  rtx op1 = gen_lowpart (V2DImode, operands[1]);
+  emit_insn (gen_p9_xxbrd_v2di (op0, op1));
+  emit_move_insn (operands[0], gen_lowpart (V2DFmode, op0));
+  DONE;
+})
+
 ;; Swap all bytes in each 32-bit element
-(define_insn "p9_xxbrw_<mode>"
-  [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
-       (bswap:VSX_W (match_operand:VSX_W 1 "vsx_register_operand" "wa")))]
+(define_insn "p9_xxbrw_v4si"
+  [(set (match_operand:V4SI 0 "vsx_register_operand" "=wa")
+       (bswap:V4SI (match_operand:V4SI 1 "vsx_register_operand" "wa")))]
   "TARGET_P9_VECTOR"
   "xxbrw %x0,%x1"
   [(set_attr "type" "vecperm")])
 
+(define_expand "p9_xxbrw_v4sf"
+  [(use (match_operand:V4SF 0 "vsx_register_operand" "=wa"))
+   (use (match_operand:V4SF 1 "vsx_register_operand" "wa"))]
+  "TARGET_P9_VECTOR"
+{
+  rtx op0 = gen_reg_rtx (V4SImode);
+  rtx op1 = gen_lowpart (V4SImode, operands[1]);
+  emit_insn (gen_p9_xxbrw_v4si (op0, op1));
+  emit_move_insn (operands[0], gen_lowpart (V4SFmode, op0));
+  DONE;
+})
+
 ;; Swap all bytes in each element of vector
 (define_expand "revb_<mode>"
-  [(set (match_operand:VEC_REVB 0 "vsx_register_operand")
-       (bswap:VEC_REVB (match_operand:VEC_REVB 1 "vsx_register_operand")))]
+  [(use (match_operand:VEC_REVB 0 "vsx_register_operand"))
+   (use (match_operand:VEC_REVB 1 "vsx_register_operand"))]
   ""
 {
   if (TARGET_P9_VECTOR)
index 4536b53a751b52fe1a90d340fae5f2e98f361874..64018db71656f90d5c7f1c0f9219517b48f4df26 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/84226
+       * gcc.target/powerpc/pr84226.c: New test.
+
 2018-02-09  Peter Bergner  <bergner@vnet.ibm.com>
 
        * gcc.target/powerpc/builtins-1-be.c <vclzb>: Rename duplicate test
diff --git a/gcc/testsuite/gcc.target/powerpc/pr84226.c b/gcc/testsuite/gcc.target/powerpc/pr84226.c
new file mode 100644 (file)
index 0000000..aae922b
--- /dev/null
@@ -0,0 +1,6 @@
+/* PR target/84226 */
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-options "-mpower9-misc -O1" } */
+
+#include "builtins-revb-runnable.c"