re PR target/62040 (internal compiler error: in simplify_const_unary_operation, at...
authorGuozhi Wei <carrot@google.com>
Thu, 4 Sep 2014 16:06:13 +0000 (16:06 +0000)
committerWei Guozhi <carrot@gcc.gnu.org>
Thu, 4 Sep 2014 16:06:13 +0000 (16:06 +0000)
PR target/62040
* config/aarch64/iterators.md (VQ_NO2E, VQ_2E): New iterators.
* config/aarch64/aarch64-simd.md (move_lo_quad_internal_<mode>): Split
it into two patterns.
(move_lo_quad_internal_be_<mode>): Likewise.

* gcc.target/aarch64/pr62040.c: New test.

From-SVN: r214905

gcc/ChangeLog
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/iterators.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/pr62040.c [new file with mode: 0644]

index a2db9c2f8a6dae7f8d80593531b53129461931a9..48fcf9c443f962c2b2214e690780181bd00f9e5a 100644 (file)
@@ -1,3 +1,11 @@
+2014-09-04  Guozhi Wei  <carrot@google.com>
+
+       PR target/62040
+       * config/aarch64/iterators.md (VQ_NO2E, VQ_2E): New iterators.
+       * config/aarch64/aarch64-simd.md (move_lo_quad_internal_<mode>): Split
+       it into two patterns.
+       (move_lo_quad_internal_be_<mode>): Likewise.
+
 2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        * doc/options.texi: Document that Var and Init are required if CPP
index f5fa4aebe4cafe1430b31ca3a89ec5f3698d23bd..c4896364f4802ef4a0dd5038980fbf73b94b1c26 100644 (file)
 ;; On big-endian this is { zeroes, operand }
 
 (define_insn "move_lo_quad_internal_<mode>"
-  [(set (match_operand:VQ 0 "register_operand" "=w,w,w")
-        (vec_concat:VQ
+  [(set (match_operand:VQ_NO2E 0 "register_operand" "=w,w,w")
+       (vec_concat:VQ_NO2E
          (match_operand:<VHALF> 1 "register_operand" "w,r,r")
          (vec_duplicate:<VHALF> (const_int 0))))]
   "TARGET_SIMD && !BYTES_BIG_ENDIAN"
    (set_attr "length" "4")]
 )
 
+(define_insn "move_lo_quad_internal_<mode>"
+  [(set (match_operand:VQ_2E 0 "register_operand" "=w,w,w")
+       (vec_concat:VQ_2E
+         (match_operand:<VHALF> 1 "register_operand" "w,r,r")
+         (const_int 0)))]
+  "TARGET_SIMD && !BYTES_BIG_ENDIAN"
+  "@
+   dup\\t%d0, %1.d[0]
+   fmov\\t%d0, %1
+   dup\\t%d0, %1"
+  [(set_attr "type" "neon_dup<q>,f_mcr,neon_dup<q>")
+   (set_attr "simd" "yes,*,yes")
+   (set_attr "fp" "*,yes,*")
+   (set_attr "length" "4")]
+)
+
 (define_insn "move_lo_quad_internal_be_<mode>"
-  [(set (match_operand:VQ 0 "register_operand" "=w,w,w")
-        (vec_concat:VQ
+  [(set (match_operand:VQ_NO2E 0 "register_operand" "=w,w,w")
+       (vec_concat:VQ_NO2E
          (vec_duplicate:<VHALF> (const_int 0))
          (match_operand:<VHALF> 1 "register_operand" "w,r,r")))]
   "TARGET_SIMD && BYTES_BIG_ENDIAN"
    (set_attr "length" "4")]
 )
 
+(define_insn "move_lo_quad_internal_be_<mode>"
+  [(set (match_operand:VQ_2E 0 "register_operand" "=w,w,w")
+       (vec_concat:VQ_2E
+         (const_int 0)
+         (match_operand:<VHALF> 1 "register_operand" "w,r,r")))]
+  "TARGET_SIMD && BYTES_BIG_ENDIAN"
+  "@
+   dup\\t%d0, %1.d[0]
+   fmov\\t%d0, %1
+   dup\\t%d0, %1"
+  [(set_attr "type" "neon_dup<q>,f_mcr,neon_dup<q>")
+   (set_attr "simd" "yes,*,yes")
+   (set_attr "fp" "*,yes,*")
+   (set_attr "length" "4")]
+)
+
 (define_expand "move_lo_quad_<mode>"
   [(match_operand:VQ 0 "register_operand")
    (match_operand:VQ 1 "register_operand")]
index 3203c3da7e293d566d1ea329856cbef8fb73a825..a00283a04b3c916422ea65c5260e39db63d1a4b3 100644 (file)
 ;; Quad vector modes.
 (define_mode_iterator VQ [V16QI V8HI V4SI V2DI V4SF V2DF])
 
+;; VQ without 2 element modes.
+(define_mode_iterator VQ_NO2E [V16QI V8HI V4SI V4SF])
+
+;; Quad vector with only 2 element modes.
+(define_mode_iterator VQ_2E [V2DI V2DF])
+
 ;; All vector modes, except double.
 (define_mode_iterator VQ_S [V8QI V16QI V4HI V8HI V2SI V4SI])
 
index 2a7e605a107d0babbf2fe834b502838c58be88c6..fb57d87d4a1e0ed39c13d2e38b95fb2a1a63132d 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-04  Guozhi Wei  <carrot@google.com>
+
+       PR target/62040
+       * gcc.target/aarch64/pr62040.c: New test.
+
 2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        * gcc.dg/cpp/endif-pedantic2.c: More general options do not
diff --git a/gcc/testsuite/gcc.target/aarch64/pr62040.c b/gcc/testsuite/gcc.target/aarch64/pr62040.c
new file mode 100644 (file)
index 0000000..cfb4979
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-g -Os" } */
+
+#include "arm_neon.h"
+
+extern void bar (int32x4_t);
+
+void
+foo ()
+{
+  int32x4x4_t rows;
+  uint64x2x2_t row01;
+
+  row01.val[0] = vreinterpretq_u64_s32 (rows.val[0]);
+  row01.val[1] = vreinterpretq_u64_s32 (rows.val[1]);
+  uint64x1_t row3l = vget_low_u64 (row01.val[0]);
+  row01.val[0] = vcombine_u64 (vget_low_u64 (row01.val[1]), row3l);
+  int32x4_t xxx = vreinterpretq_s32_u64 (row01.val[0]);
+  int32x4_t out = vtrn1q_s32 (xxx, xxx);
+  bar (out);
+}