diff options
-rw-r--r-- | gas/config/tc-aarch64.c | 3 | ||||
-rw-r--r-- | include/opcode/aarch64.h | 3 | ||||
-rw-r--r-- | opcodes/aarch64-opc.c | 13 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index c8e3762..71b63d3 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -8116,8 +8116,7 @@ md_assemble (char *str) && do_encode (inst_base->opcode, &inst.base, &inst_base->value)) { /* Check that this instruction is supported for this CPU. */ - if (!opcode->avariant - || !AARCH64_CPU_HAS_ALL_FEATURES (cpu_variant, *opcode->avariant)) + if (!aarch64_cpu_supports_inst_p (cpu_variant, inst_base)) { as_bad (_("selected processor does not support `%s'"), str); return; diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index d09897f..61afe56 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -1471,6 +1471,9 @@ aarch64_get_operand_desc (enum aarch64_opnd); extern bool aarch64_sve_dupm_mov_immediate_p (uint64_t, int); +extern bool +aarch64_cpu_supports_inst_p (uint64_t, aarch64_inst *); + #ifdef DEBUG_AARCH64 extern int debug_dump; diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index b902901..7a88c19 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -6158,6 +6158,19 @@ aarch64_sve_dupm_mov_immediate_p (uint64_t uvalue, int esize) return svalue < -128 || svalue >= 128; } +/* Return true if a CPU with the AARCH64_FEATURE_* bits in CPU_VARIANT + supports the instruction described by INST. */ + +bool +aarch64_cpu_supports_inst_p (uint64_t cpu_variant, aarch64_inst *inst) +{ + if (!inst->opcode->avariant + || !AARCH64_CPU_HAS_ALL_FEATURES (cpu_variant, *inst->opcode->avariant)) + return false; + + return true; +} + /* Include the opcode description table as well as the operand description table. */ #define VERIFIER(x) verify_##x |