commit 796f7ec499411034d5eb7441b51d0493d6299327
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Wed Aug 6 16:47:29 2014 +0100
[AArch64] PR target/61749 Fix ICE when passing non-literal lane to some intrinsics
@@ -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]
@@ -907,8 +907,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:
@@ -975,7 +978,7 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval,
}
if (!pat)
- return 0;
+ return NULL_RTX;
emit_insn (pat);
@@ -1071,8 +1074,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;
}
@@ -1124,7 +1128,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
@@ -157,16 +157,16 @@
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>. */
new file mode 100644
@@ -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" } */