vabs_intrinsic_2.c: New test.
authorAlan Lawrence <alan.lawrence@arm.com>
Tue, 9 Dec 2014 19:19:54 +0000 (19:19 +0000)
committerAlan Lawrence <alalaw01@gcc.gnu.org>
Tue, 9 Dec 2014 19:19:54 +0000 (19:19 +0000)
gcc/testsuite/:

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

From-SVN: r218530

gcc/ChangeLog
gcc/config/aarch64/aarch64-builtins.c
gcc/config/aarch64/aarch64.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/vabs_intrinsic_2.c [new file with mode: 0644]

index 7002a151e0bc1fcf65dacefdeed764e7df8ef402..c5a3718ffbce407c6e0986d23e1c1e1d1072c1eb 100644 (file)
@@ -1,3 +1,12 @@
+2014-12-09  Alan Lawrence  <alan.lawrence@arm.com>
+
+       * config/aarch64/aarch64.md (absdi2): Remove scratch operand by
+       earlyclobbering result operand.
+
+       * config/aarch64/aarch64-builtins.c (aarch64_types_unop_qualifiers):
+       Remove final qualifier_internal.
+       (aarch64_fold_builtin): Stop folding abs builtins, except on floats.
+
 2014-12-09  Wilco Dijkstra  <wilco.dijkstra@arm.com>
 
        * gcc/config/aarch64/aarch64-protos.h (tune-params): Add reasociation
index aac7269337c46a9af5dffaeeed85f3b812c9c9fb..6df42fde8e84106486d2a57e61672131adfca96b 100644 (file)
@@ -128,11 +128,9 @@ typedef struct
   enum aarch64_type_qualifiers *qualifiers;
 } aarch64_simd_builtin_datum;
 
-/*  The qualifier_internal allows generation of a unary builtin from
-    a pattern with a third pseudo-operand such as a match_scratch.  */
 static enum aarch64_type_qualifiers
 aarch64_types_unop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
-  = { qualifier_none, qualifier_none, qualifier_internal };
+  = { qualifier_none, qualifier_none };
 #define TYPES_UNOP (aarch64_types_unop_qualifiers)
 static enum aarch64_type_qualifiers
 aarch64_types_unopu_qualifiers[SIMD_MAX_BUILTIN_ARGS]
@@ -1282,7 +1280,7 @@ aarch64_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *args,
 
   switch (fcode)
     {
-      BUILTIN_VALLDI (UNOP, abs, 2)
+      BUILTIN_VDQF (UNOP, abs, 2)
        return fold_build1 (ABS_EXPR, type, args[0]);
        break;
       VAR1 (UNOP, floatv2si, 2, v2sf)
index 1bbcc7bd5676e9ebd0a190bc3f399cea91b51343..97d7009c20f38071f006f33978985b5e6c889794 100644 (file)
 )
 
 (define_insn_and_split "absdi2"
-  [(set (match_operand:DI 0 "register_operand" "=r,w")
-       (abs:DI (match_operand:DI 1 "register_operand" "r,w")))
-   (clobber (match_scratch:DI 2 "=&r,X"))]
+  [(set (match_operand:DI 0 "register_operand" "=&r,w")
+       (abs:DI (match_operand:DI 1 "register_operand" "r,w")))]
   ""
   "@
    #
    && GP_REGNUM_P (REGNO (operands[1]))"
   [(const_int 0)]
   {
-    emit_insn (gen_rtx_SET (VOIDmode, operands[2],
+    emit_insn (gen_rtx_SET (VOIDmode, operands[0],
                            gen_rtx_XOR (DImode,
                                         gen_rtx_ASHIFTRT (DImode,
                                                           operands[1],
     emit_insn (gen_rtx_SET (VOIDmode,
                            operands[0],
                            gen_rtx_MINUS (DImode,
-                                          operands[2],
+                                          operands[0],
                                           gen_rtx_ASHIFTRT (DImode,
                                                             operands[1],
                                                             GEN_INT (63)))));
index 177fe2443a0b73e699dba0acd70f7564743cc45a..e7a3e48787ccfc1700b9a0f0f2035764d05625d7 100644 (file)
@@ -1,3 +1,7 @@
+2014-12-09  Alan Lawrence  <alan.lawrence@arm.com>
+
+       * gcc.target/aarch64/vabs_intrinsic_2.c: New test.
+
 2014-12-09  David Malcolm  <dmalcolm@redhat.com>
 
        PR jit/64166
diff --git a/gcc/testsuite/gcc.target/aarch64/vabs_intrinsic_2.c b/gcc/testsuite/gcc.target/aarch64/vabs_intrinsic_2.c
new file mode 100644 (file)
index 0000000..12fdd81
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <arm_neon.h>
+
+extern void abort (void);
+
+int
+main (int argc, char **argv)
+{
+  int8x8_t a = vabs_s8 (vdup_n_s8 (-128)); /* Should all be -128.  */
+  uint8x8_t b = vcltz_s8 (a); /* Should all be true i.e. -1. */
+  if (vget_lane_u8 (b, 1))
+    return 0;
+  abort ();
+}
+