From 859f51df4d0e23c21adc2167d738cf1e6c0f2613 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 30 Mar 2023 11:09:07 +0100 Subject: aarch64: Add an error code for out-of-range registers libopcodes currently reports out-of-range registers as a general AARCH64_OPDE_OTHER_ERROR. However, this means that each register range needs its own hard-coded string, which is a bit cumbersome if the range is determined programmatically. This patch therefore adds a dedicated error type for out-of-range errors. --- include/opcode/aarch64.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index 10c7983aa2d..6615dec41a7 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -1311,6 +1311,13 @@ struct aarch64_inst Error of the highest severity and used for any severe issue that does not fall into any of the above categories. + AARCH64_OPDE_INVALID_REGNO + A register was syntactically valid and had the right type, but it was + outside the range supported by the associated operand field. This is + a high severity error because there are currently no instructions that + would accept the operands that precede the erroneous one (if any) and + yet still accept a wider range of registers. + AARCH64_OPDE_RECOVERABLE, AARCH64_OPDE_SYNTAX_ERROR and AARCH64_OPDE_FATAL_SYNTAX_ERROR are only deteced by GAS while the AARCH64_OPDE_INVALID_VARIANT error can only be spotted by libopcodes as @@ -1339,7 +1346,8 @@ enum aarch64_operand_error_kind AARCH64_OPDE_UNTIED_OPERAND, AARCH64_OPDE_OUT_OF_RANGE, AARCH64_OPDE_UNALIGNED, - AARCH64_OPDE_OTHER_ERROR + AARCH64_OPDE_OTHER_ERROR, + AARCH64_OPDE_INVALID_REGNO }; /* N.B. GAS assumes that this structure work well with shallow copy. */ -- cgit v1.2.1