gcc/ 2014-12-04 Yvan Roux <yvan.roux@linaro.org>
authoryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Dec 2014 13:25:10 +0000 (13:25 +0000)
committerDongkyun, Son <dongkyun.s@samsung.com>
Sat, 6 Jun 2015 14:26:49 +0000 (23:26 +0900)
Backport from trunk r215046.
2014-09-09  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

PR target/61749
* config/aarch64/aarch64-builtins.c (aarch64_types_quadop_qualifiers):
Use qualifier_immediate for last operand.  Rename to...
(aarch64_types_ternop_lane_qualifiers): ... This.
(TYPES_QUADOP): Rename to...
(TYPES_TERNOP_LANE): ... This.
(aarch64_simd_expand_args): Return const0_rtx when encountering user
error.  Change return of 0 to return of NULL_RTX.
(aarch64_crc32_expand_builtin): Likewise.
(aarch64_expand_builtin): Return NULL_RTX instead of 0.
ICE when expanding unknown builtin.
* config/aarch64/aarch64-simd-builtins.def (sqdmlal_lane): Use
TERNOP_LANE qualifiers.
(sqdmlsl_lane): Likewise.
(sqdmlal_laneq): Likewise.
(sqdmlsl_laneq): Likewise.
(sqdmlal2_lane): Likewise.
(sqdmlsl2_lane): Likewise.
(sqdmlal2_laneq): Likewise.
(sqdmlsl2_laneq): Likewise.

gcc/testsuite/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r215046.
2014-09-09  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

PR target/61749
* gcc.target/aarch64/vqdml_lane_intrinsics-bad_1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218358 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog.linaro
gcc/config/aarch64/aarch64-builtins.c
gcc/config/aarch64/aarch64-simd-builtins.def
gcc/testsuite/ChangeLog.linaro
gcc/testsuite/gcc.target/aarch64/vqdml_lane_intrinsics-bad_1.c [new file with mode: 0644]

index 07778e5..3b64a4d 100644 (file)
@@ -1,5 +1,31 @@
 2014-12-04  Yvan Roux  <yvan.roux@linaro.org>
 
+       Backport from trunk r215046.
+       2014-09-09  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/61749
+       * config/aarch64/aarch64-builtins.c (aarch64_types_quadop_qualifiers):
+       Use qualifier_immediate for last operand.  Rename to...
+       (aarch64_types_ternop_lane_qualifiers): ... This.
+       (TYPES_QUADOP): Rename to...
+       (TYPES_TERNOP_LANE): ... This.
+       (aarch64_simd_expand_args): Return const0_rtx when encountering user
+       error.  Change return of 0 to return of NULL_RTX.
+       (aarch64_crc32_expand_builtin): Likewise.
+       (aarch64_expand_builtin): Return NULL_RTX instead of 0.
+       ICE when expanding unknown builtin.
+       * config/aarch64/aarch64-simd-builtins.def (sqdmlal_lane): Use
+       TERNOP_LANE qualifiers.
+       (sqdmlsl_lane): Likewise.
+       (sqdmlal_laneq): Likewise.
+       (sqdmlsl_laneq): Likewise.
+       (sqdmlal2_lane): Likewise.
+       (sqdmlsl2_lane): Likewise.
+       (sqdmlal2_laneq): Likewise.
+       (sqdmlsl2_laneq): Likewise.
+
+2014-12-04  Yvan Roux  <yvan.roux@linaro.org>
+
        Backport from trunk r215013.
        2014-09-08  Joseph Myers  <joseph@codesourcery.com>
 
index 19a2d8e..a1ed31a 100644 (file)
@@ -178,10 +178,10 @@ aarch64_types_ternopu_qualifiers[SIMD_MAX_BUILTIN_ARGS]
 #define TYPES_TERNOPU (aarch64_types_ternopu_qualifiers)
 
 static enum aarch64_type_qualifiers
-aarch64_types_quadop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
+aarch64_types_ternop_lane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
   = { qualifier_none, qualifier_none, qualifier_none,
-      qualifier_none, qualifier_none };
-#define TYPES_QUADOP (aarch64_types_quadop_qualifiers)
+      qualifier_none, qualifier_immediate };
+#define TYPES_TERNOP_LANE (aarch64_types_ternop_lane_qualifiers)
 
 static enum aarch64_type_qualifiers
 aarch64_types_getlane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
@@ -818,8 +818,11 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval,
            case SIMD_ARG_CONSTANT:
              if (!(*insn_data[icode].operand[argc + have_retval].predicate)
                  (op[argc], mode[argc]))
+             {
                error_at (EXPR_LOCATION (exp), "incompatible type for argument %d, "
                       "expected %<const int%>", argc + 1);
+               return const0_rtx;
+             }
              break;
 
            case SIMD_ARG_STOP:
@@ -884,7 +887,7 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval,
       }
 
   if (!pat)
-    return 0;
+    return NULL_RTX;
 
   emit_insn (pat);
 
@@ -975,8 +978,9 @@ aarch64_crc32_expand_builtin (int fcode, tree exp, rtx target)
     op1 = copy_to_mode_reg (mode1, op1);
 
   pat = GEN_FCN (icode) (target, op0, op1);
-  if (! pat)
-    return 0;
+  if (!pat)
+    return NULL_RTX;
+
   emit_insn (pat);
   return target;
 }
@@ -1028,7 +1032,7 @@ aarch64_expand_builtin (tree exp,
   else if (fcode >= AARCH64_CRC32_BUILTIN_BASE && fcode <= AARCH64_CRC32_BUILTIN_MAX)
     return aarch64_crc32_expand_builtin (fcode, exp, target);
 
-  return NULL_RTX;
+  gcc_unreachable ();
 }
 
 tree
index 77c38a8..1c8291d 100644 (file)
   BUILTIN_VSDQ_I (UNOP, sqabs, 0)
   BUILTIN_VSDQ_I (UNOP, sqneg, 0)
 
-  BUILTIN_VSD_HSI (QUADOP, sqdmlal_lane, 0)
-  BUILTIN_VSD_HSI (QUADOP, sqdmlsl_lane, 0)
-  BUILTIN_VSD_HSI (QUADOP, sqdmlal_laneq, 0)
-  BUILTIN_VSD_HSI (QUADOP, sqdmlsl_laneq, 0)
+  BUILTIN_VSD_HSI (TERNOP_LANE, sqdmlal_lane, 0)
+  BUILTIN_VSD_HSI (TERNOP_LANE, sqdmlsl_lane, 0)
+  BUILTIN_VSD_HSI (TERNOP_LANE, sqdmlal_laneq, 0)
+  BUILTIN_VSD_HSI (TERNOP_LANE, sqdmlsl_laneq, 0)
   BUILTIN_VQ_HSI (TERNOP, sqdmlal2, 0)
   BUILTIN_VQ_HSI (TERNOP, sqdmlsl2, 0)
-  BUILTIN_VQ_HSI (QUADOP, sqdmlal2_lane, 0)
-  BUILTIN_VQ_HSI (QUADOP, sqdmlsl2_lane, 0)
-  BUILTIN_VQ_HSI (QUADOP, sqdmlal2_laneq, 0)
-  BUILTIN_VQ_HSI (QUADOP, sqdmlsl2_laneq, 0)
+  BUILTIN_VQ_HSI (TERNOP_LANE, sqdmlal2_lane, 0)
+  BUILTIN_VQ_HSI (TERNOP_LANE, sqdmlsl2_lane, 0)
+  BUILTIN_VQ_HSI (TERNOP_LANE, sqdmlal2_laneq, 0)
+  BUILTIN_VQ_HSI (TERNOP_LANE, sqdmlsl2_laneq, 0)
   BUILTIN_VQ_HSI (TERNOP, sqdmlal2_n, 0)
   BUILTIN_VQ_HSI (TERNOP, sqdmlsl2_n, 0)
   /* Implemented by aarch64_sqdml<SBINQOPS:as>l<mode>.  */
index d81a4e4..3e70744 100644 (file)
@@ -1,5 +1,13 @@
 2014-12-04  Yvan Roux  <yvan.roux@linaro.org>
 
+       Backport from trunk r215046.
+       2014-09-09  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/61749
+       * gcc.target/aarch64/vqdml_lane_intrinsics-bad_1.c: New test.
+
+2014-12-04  Yvan Roux  <yvan.roux@linaro.org>
+
        Backport from trunk r214950.
        2014-09-05  Alan Lawrence  <alan.lawrence@arm.com>
 
diff --git a/gcc/testsuite/gcc.target/aarch64/vqdml_lane_intrinsics-bad_1.c b/gcc/testsuite/gcc.target/aarch64/vqdml_lane_intrinsics-bad_1.c
new file mode 100644 (file)
index 0000000..314a624
--- /dev/null
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+
+#include "arm_neon.h"
+
+int32x4_t
+foo (int32x4_t a, int16x4_t b, int16x4_t c, int d)
+{
+  return vqdmlal_lane_s16 (a, b, c, d);
+}
+
+int32x4_t
+foo1 (int32x4_t a, int16x4_t b, int16x8_t c, int d)
+{
+  return vqdmlal_laneq_s16 (a, b, c, d);
+}
+
+int32x4_t
+foo2 (int32x4_t a, int16x4_t b, int16x4_t c, int d)
+{
+  return vqdmlsl_lane_s16 (a, b, c, d);
+}
+
+int32x4_t
+foo3 (int32x4_t a, int16x4_t b, int16x8_t c, int d)
+{
+  return vqdmlsl_laneq_s16 (a, b, c, d);
+}
+
+int32x4_t
+foo4 (int32x4_t a, int16x8_t b, int16x4_t c, int d)
+{
+  return vqdmlal_high_lane_s16 (a, b, c, d);
+}
+
+int32x4_t
+foo5 (int32x4_t a, int16x8_t b, int16x4_t c, int d)
+{
+  return vqdmlsl_high_lane_s16 (a, b, c, d);
+}
+
+int32x4_t
+foo6 (int32x4_t a, int16x8_t b, int16x8_t c, int d)
+{
+  return vqdmlal_high_laneq_s16 (a, b, c, d);
+}
+
+int32x4_t
+foo7 (int32x4_t a, int16x8_t b, int16x8_t c, int d)
+{
+  return vqdmlsl_high_laneq_s16 (a, b, c, d);
+}
+
+
+/* { dg-excess-errors "incompatible type for argument" } */