Commit fca051af by Alan Lawrence Committed by Alan Lawrence

[AArch64]Improve error message for non-constant immediates

gcc/:

	* gcc/config/aarch64-builtins.c (aarch64_simd_expand_args): Update error
	message for SIMD_ARG_CONSTANT.

gcc/testsuite/:

	* gcc.target/aarch64/arg-type-diagnostics-1.c: Call intrinsic, update
	expected error message.

From-SVN: r218534
parent d1e5f2c7
2014-12-09 Alan Lawrence <alan.lawrence@arm.com> 2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* gcc/config/aarch64-builtins.c (aarch64_simd_expand_args): Update error
message for SIMD_ARG_CONSTANT.
2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* config/aarch64/aarch64-builtins.c (aarch64_types_binopv_qualifiers, * config/aarch64/aarch64-builtins.c (aarch64_types_binopv_qualifiers,
TYPES_BINOPV): Delete. TYPES_BINOPV): Delete.
(enum aarch64_builtins): Add AARCH64_BUILTIN_SIMD_LANE_CHECK and (enum aarch64_builtins): Add AARCH64_BUILTIN_SIMD_LANE_CHECK and
...@@ -926,8 +926,8 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval, ...@@ -926,8 +926,8 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval,
if (!(*insn_data[icode].operand[opc].predicate) if (!(*insn_data[icode].operand[opc].predicate)
(op[opc], mode)) (op[opc], mode))
{ {
error_at (EXPR_LOCATION (exp), "incompatible type for argument %d, " error ("%Kargument %d must be a constant immediate",
"expected %<const int%>", opc + 1); exp, opc + 1 - have_retval);
return const0_rtx; return const0_rtx;
} }
break; break;
......
2014-12-09 Alan Lawrence <alan.lawrence@arm.com> 2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* gcc.target/aarch64/arg-type-diagnostics-1.c: Call intrinsic, update
expected error message.
2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* gcc.target/aarch64/simd/vset_lane_s16_const_1.c: New test. * gcc.target/aarch64/simd/vset_lane_s16_const_1.c: New test.
2014-12-09 Alan Lawrence <alan.lawrence@arm.com> 2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
......
...@@ -3,13 +3,16 @@ ...@@ -3,13 +3,16 @@
#include "arm_neon.h" #include "arm_neon.h"
void foo () void foo (int a)
{ {
int a;
int32x2_t arg1; int32x2_t arg1;
int32x2_t arg2; int32x2_t arg2;
int32x2_t result; int32x2_t result;
arg1 = vcreate_s32 (UINT64_C (0x0000ffffffffffff)); arg1 = vcreate_s32 (UINT64_C (0x0000ffffffffffff));
arg2 = vcreate_s32 (UINT64_C (0x16497fffffffffff)); arg2 = vcreate_s32 (UINT64_C (0x16497fffffffffff));
result = __builtin_aarch64_srsra_nv2si (arg1, arg2, a); /* { dg-error "incompatible type for argument" } */ /* The correct line number is in the preamble to the error message,
not in the final line (which is all that dg-error inspects). Hence,
we have to tell dg-error to ignore the line number. */
result = vrsra_n_s32 (arg1, arg2, a);
/* { dg-error "must be a constant immediate" "" { target *-*-* } 0 } */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment