From f11f256f5638679548cd7e1fb189135575cb7b5f Mon Sep 17 00:00:00 2001 From: Victor Do Nascimento Date: Thu, 9 Nov 2023 11:19:47 +0000 Subject: aarch64: Fix error in THE system register checking The erroneous omission of a "reg_value == " in the THE system register encoding check added in [1] led to an error which was not picked up in GCC but which was flagged in Clang due to its use of [-Werror,-Wconstant-logical-operand] check. Together with this fix we add a new test for the THE registers to pick up their illegal use, adding an extra and important layer of validation. Furthermore, in separating system register from instruction implementation (with which only the former was of concern in the cited patch), additions made to `aarch64-tbl.h' are rolled back so that these can be added later when adding THE instructions to the codebase, a more natural place for these changes. [1] https://sourceware.org/pipermail/binutils/2023-November/130314.html opcodes/ChangeLog: * aarch64-opc.c (aarch64_sys_ins_reg_supported_p): Fix typo. * aarch64-tbl.h (THE): Remove. (aarch64_feature_set aarch64_feature_the): Likewise. gas/ChangeLog: * testsuite/gas/aarch64/illegal-sysreg-8.l: Add tests for THE system registers. * testsuite/gas/aarch64/illegal-sysreg-8.s: Likewise. --- opcodes/aarch64-tbl.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'opcodes/aarch64-tbl.h') diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h index feea209..74fd669 100644 --- a/opcodes/aarch64-tbl.h +++ b/opcodes/aarch64-tbl.h @@ -2578,8 +2578,6 @@ static const aarch64_feature_set aarch64_feature_chk = AARCH64_FEATURE (CHK); static const aarch64_feature_set aarch64_feature_gcs = AARCH64_FEATURE (GCS); -static const aarch64_feature_set aarch64_feature_the = - AARCH64_FEATURE (THE); #define CORE &aarch64_feature_v8 #define FP &aarch64_feature_fp @@ -2641,7 +2639,6 @@ static const aarch64_feature_set aarch64_feature_the = #define CSSC &aarch64_feature_cssc #define CHK &aarch64_feature_chk #define GCS &aarch64_feature_gcs -#define THE &aarch64_feature_the #define CORE_INSN(NAME,OPCODE,MASK,CLASS,OP,OPS,QUALS,FLAGS) \ { NAME, OPCODE, MASK, CLASS, OP, CORE, OPS, QUALS, FLAGS, 0, 0, NULL } -- cgit v1.1