From 199cfcc4754cea6f4c42dcbb8d8d5161f5b2d186 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 30 Mar 2023 11:09:09 +0100 Subject: aarch64: Add a aarch64_cpu_supports_inst_p helper Quite a lot of SME2 instructions have an opcode bit that selects between 32-bit and 64-bit forms of an instruction, with the 32-bit forms being part of base SME2 and with the 64-bit forms being part of an optional extension. It's nevertheless useful to have a single opcode entry for both forms since (a) that matches the ISA definition and (b) it tends to improve error reporting. This patch therefore adds a libopcodes function called aarch64_cpu_supports_inst_p that tests whether the target supports a particular instruction. In future it will depend on internal libopcodes routines. --- include/opcode/aarch64.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index d09897f48d4..61afe561a12 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; -- cgit v1.2.1