diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2021-12-02 15:00:57 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2021-12-02 15:00:57 +0000 |
commit | 6327658ee73502ffb55dfb6b28a20d1dde15a4dc (patch) | |
tree | 13b1c36b6ded6afcde85d45b69971548bb22c37d /opcodes | |
parent | a5e9beead8580777ea4886b06c493a6f79570f93 (diff) | |
download | binutils-6327658ee73502ffb55dfb6b28a20d1dde15a4dc.zip binutils-6327658ee73502ffb55dfb6b28a20d1dde15a4dc.tar.gz binutils-6327658ee73502ffb55dfb6b28a20d1dde15a4dc.tar.bz2 |
aarch64: Add support for +mops
This patch adds support for FEAT_MOPS, an Armv8.8-A extension
that provides memcpy and memset acceleration instructions.
I took the perhaps controversial decision to generate the individual
instruction forms using macros rather than list them out individually.
This becomes useful with a follow-on patch to check that code follows
the correct P/M/E sequence.
[https://developer.arm.com/documentation/ddi0596/2021-09/Base-Instructions?lang=en]
include/
* opcode/aarch64.h (AARCH64_FEATURE_MOPS): New macro.
(AARCH64_ARCH_V8_8): Make armv8.8-a imply AARCH64_FEATURE_MOPS.
(AARCH64_OPND_MOPS_ADDR_Rd): New aarch64_opnd.
(AARCH64_OPND_MOPS_ADDR_Rs): Likewise.
(AARCH64_OPND_MOPS_WB_Rn): Likewise.
opcodes/
* aarch64-asm.h (ins_x0_to_x30): New inserter.
* aarch64-asm.c (aarch64_ins_x0_to_x30): New function.
* aarch64-dis.h (ext_x0_to_x30): New extractor.
* aarch64-dis.c (aarch64_ext_x0_to_x30): New function.
* aarch64-tbl.h (aarch64_feature_mops): New feature set.
(aarch64_feature_mops_memtag): Likewise.
(MOPS, MOPS_MEMTAG, MOPS_INSN, MOPS_MEMTAG_INSN)
(MOPS_CPY_OP1_OP2_PME_INSN, MOPS_CPY_OP1_OP2_INSN, MOPS_CPY_OP1_INSN)
(MOPS_CPY_INSN, MOPS_SET_OP1_OP2_PME_INSN, MOPS_SET_OP1_OP2_INSN)
(MOPS_SET_INSN): New macros.
(aarch64_opcode_table): Add MOPS instructions.
(aarch64_opcode_table): Add entries for AARCH64_OPND_MOPS_ADDR_Rd,
AARCH64_OPND_MOPS_ADDR_Rs and AARCH64_OPND_MOPS_WB_Rn.
* aarch64-opc.c (aarch64_print_operand): Handle
AARCH64_OPND_MOPS_ADDR_Rd, AARCH64_OPND_MOPS_ADDR_Rs and
AARCH64_OPND_MOPS_WB_Rn.
(verify_three_different_regs): New function.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Likewise.
* aarch64-opc-2.c: Likewise.
gas/
* doc/c-aarch64.texi: Document +mops.
* config/tc-aarch64.c (parse_x0_to_x30): New function.
(parse_operands): Handle AARCH64_OPND_MOPS_ADDR_Rd,
AARCH64_OPND_MOPS_ADDR_Rs and AARCH64_OPND_MOPS_WB_Rn.
(aarch64_features): Add "mops".
* testsuite/gas/aarch64/mops.s, testsuite/gas/aarch64/mops.d: New test.
* testsuite/gas/aarch64/mops_invalid.s,
* testsuite/gas/aarch64/mops_invalid.d,
* testsuite/gas/aarch64/mops_invalid.l: Likewise.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/aarch64-asm-2.c | 4 | ||||
-rw-r--r-- | opcodes/aarch64-asm.c | 13 | ||||
-rw-r--r-- | opcodes/aarch64-asm.h | 1 | ||||
-rw-r--r-- | opcodes/aarch64-dis-2.c | 1386 | ||||
-rw-r--r-- | opcodes/aarch64-dis.c | 11 | ||||
-rw-r--r-- | opcodes/aarch64-dis.h | 1 | ||||
-rw-r--r-- | opcodes/aarch64-opc-2.c | 3 | ||||
-rw-r--r-- | opcodes/aarch64-opc.c | 41 | ||||
-rw-r--r-- | opcodes/aarch64-tbl.h | 107 |
9 files changed, 1535 insertions, 32 deletions
diff --git a/opcodes/aarch64-asm-2.c b/opcodes/aarch64-asm-2.c index bbe4b68..57c9e30 100644 --- a/opcodes/aarch64-asm-2.c +++ b/opcodes/aarch64-asm-2.c @@ -893,6 +893,10 @@ aarch64_insert_operand (const aarch64_operand *self, return aarch64_ins_sme_sm_za (self, info, code, inst, errors); case 220: return aarch64_ins_sme_pred_reg_with_index (self, info, code, inst, errors); + case 223: + case 224: + case 225: + return aarch64_ins_x0_to_x30 (self, info, code, inst, errors); default: assert (0); abort (); } } diff --git a/opcodes/aarch64-asm.c b/opcodes/aarch64-asm.c index 9b66fd3..f8328eb 100644 --- a/opcodes/aarch64-asm.c +++ b/opcodes/aarch64-asm.c @@ -1519,6 +1519,19 @@ aarch64_ins_sme_pred_reg_with_index (const aarch64_operand *self, return true; } +/* Insert X0-X30. Register 31 is unallocated. */ +bool +aarch64_ins_x0_to_x30 (const aarch64_operand *self, + const aarch64_opnd_info *info, + aarch64_insn *code, + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) +{ + assert (info->reg.regno <= 30); + insert_field (self->fields[0], code, info->reg.regno, 0); + return true; +} + /* Miscellaneous encoding functions. */ /* Encode size[0], i.e. bit 22, for diff --git a/opcodes/aarch64-asm.h b/opcodes/aarch64-asm.h index 47f775d..ac97b9e 100644 --- a/opcodes/aarch64-asm.h +++ b/opcodes/aarch64-asm.h @@ -106,6 +106,7 @@ AARCH64_DECL_OPD_INSERTER (ins_sme_sm_za); AARCH64_DECL_OPD_INSERTER (ins_sme_pred_reg_with_index); AARCH64_DECL_OPD_INSERTER (ins_imm_rotate1); AARCH64_DECL_OPD_INSERTER (ins_imm_rotate2); +AARCH64_DECL_OPD_INSERTER (ins_x0_to_x30); #undef AARCH64_DECL_OPD_INSERTER diff --git a/opcodes/aarch64-dis-2.c b/opcodes/aarch64-dis-2.c index f9999ad..70cbf90 100644 --- a/opcodes/aarch64-dis-2.c +++ b/opcodes/aarch64-dis-2.c @@ -2947,11 +2947,187 @@ aarch64_opcode_lookup_1 (uint32_t word) } else { - /* 33222222222211111111110000000000 - 10987654321098765432109876543210 - xx01100100xxxxxxxxxxx1xxxxxxxxxx - stg. */ - return 885; + if (((word >> 21) & 0x1) == 0) + { + if (((word >> 12) & 0x1) == 0) + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0000x1xxxxxxxxxx + cpyfp. */ + return 2511; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1000x1xxxxxxxxxx + cpyfprn. */ + return 2517; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0100x1xxxxxxxxxx + cpyfpwn. */ + return 2514; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1100x1xxxxxxxxxx + cpyfpn. */ + return 2520; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0010x1xxxxxxxxxx + cpyfprt. */ + return 2535; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1010x1xxxxxxxxxx + cpyfprtrn. */ + return 2541; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0110x1xxxxxxxxxx + cpyfprtwn. */ + return 2538; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1110x1xxxxxxxxxx + cpyfprtn. */ + return 2544; + } + } + } + } + else + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0001x1xxxxxxxxxx + cpyfpwt. */ + return 2523; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1001x1xxxxxxxxxx + cpyfpwtrn. */ + return 2529; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0101x1xxxxxxxxxx + cpyfpwtwn. */ + return 2526; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1101x1xxxxxxxxxx + cpyfpwtn. */ + return 2532; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0011x1xxxxxxxxxx + cpyfpt. */ + return 2547; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1011x1xxxxxxxxxx + cpyfptrn. */ + return 2553; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx0111x1xxxxxxxxxx + cpyfptwn. */ + return 2550; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001000xxxxx1111x1xxxxxxxxxx + cpyfptn. */ + return 2556; + } + } + } + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001001xxxxxxxxxx1xxxxxxxxxx + stg. */ + return 885; + } } } else @@ -3054,11 +3230,187 @@ aarch64_opcode_lookup_1 (uint32_t word) } else { - /* 33222222222211111111110000000000 - 10987654321098765432109876543210 - xx01100101xxxxxxxxxxx1xxxxxxxxxx - stzg. */ - return 886; + if (((word >> 21) & 0x1) == 0) + { + if (((word >> 12) & 0x1) == 0) + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0000x1xxxxxxxxxx + cpyfm. */ + return 2512; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1000x1xxxxxxxxxx + cpyfmrn. */ + return 2518; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0100x1xxxxxxxxxx + cpyfmwn. */ + return 2515; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1100x1xxxxxxxxxx + cpyfmn. */ + return 2521; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0010x1xxxxxxxxxx + cpyfmrt. */ + return 2536; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1010x1xxxxxxxxxx + cpyfmrtrn. */ + return 2542; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0110x1xxxxxxxxxx + cpyfmrtwn. */ + return 2539; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1110x1xxxxxxxxxx + cpyfmrtn. */ + return 2545; + } + } + } + } + else + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0001x1xxxxxxxxxx + cpyfmwt. */ + return 2524; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1001x1xxxxxxxxxx + cpyfmwtrn. */ + return 2530; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0101x1xxxxxxxxxx + cpyfmwtwn. */ + return 2527; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1101x1xxxxxxxxxx + cpyfmwtn. */ + return 2533; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0011x1xxxxxxxxxx + cpyfmt. */ + return 2548; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1011x1xxxxxxxxxx + cpyfmtrn. */ + return 2554; + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx0111x1xxxxxxxxxx + cpyfmtwn. */ + return 2551; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001010xxxxx1111x1xxxxxxxxxx + cpyfmtn. */ + return 2557; + } + } + } + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001011xxxxxxxxxx1xxxxxxxxxx + stzg. */ + return 886; + } } } else @@ -3195,21 +3547,329 @@ aarch64_opcode_lookup_1 (uint32_t word) } else { - if (((word >> 22) & 0x1) == 0) + if (((word >> 21) & 0x1) == 0) { - /* 33222222222211111111110000000000 - 10987654321098765432109876543210 - xx01100110xxxxxxxxxxx1xxxxxxxxxx - st2g. */ - return 887; + if (((word >> 12) & 0x1) == 0) + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0000x1xxxxxxxxxx + cpyfe. */ + return 2513; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0000x1xxxxxxxxxx + setp. */ + return 2607; + } + } + else + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx1000x1xxxxxxxxxx + cpyfern. */ + return 2519; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx1000x1xxxxxxxxxx + sete. */ + return 2609; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0100x1xxxxxxxxxx + cpyfewn. */ + return 2516; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0100x1xxxxxxxxxx + setm. */ + return 2608; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx0110011x0xxxxx1100x1xxxxxxxxxx + cpyfen. */ + return 2522; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0010x1xxxxxxxxxx + cpyfert. */ + return 2537; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0010x1xxxxxxxxxx + setpn. */ + return 2613; + } + } + else + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx1010x1xxxxxxxxxx + cpyfertrn. */ + return 2543; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx1010x1xxxxxxxxxx + seten. */ + return 2615; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0110x1xxxxxxxxxx + cpyfertwn. */ + return 2540; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0110x1xxxxxxxxxx + setmn. */ + return 2614; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx0110011x0xxxxx1110x1xxxxxxxxxx + cpyfertn. */ + return 2546; + } + } + } + } + else + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0001x1xxxxxxxxxx + cpyfewt. */ + return 2525; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0001x1xxxxxxxxxx + setpt. */ + return 2610; + } + } + else + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx1001x1xxxxxxxxxx + cpyfewtrn. */ + return 2531; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx1001x1xxxxxxxxxx + setet. */ + return 2612; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0101x1xxxxxxxxxx + cpyfewtwn. */ + return 2528; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0101x1xxxxxxxxxx + setmt. */ + return 2611; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx0110011x0xxxxx1101x1xxxxxxxxxx + cpyfewtn. */ + return 2534; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0011x1xxxxxxxxxx + cpyfet. */ + return 2549; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0011x1xxxxxxxxxx + setptn. */ + return 2616; + } + } + else + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx1011x1xxxxxxxxxx + cpyfetrn. */ + return 2555; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx1011x1xxxxxxxxxx + setetn. */ + return 2618; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001100xxxxx0111x1xxxxxxxxxx + cpyfetwn. */ + return 2552; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001110xxxxx0111x1xxxxxxxxxx + setmtn. */ + return 2617; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx0110011x0xxxxx1111x1xxxxxxxxxx + cpyfetn. */ + return 2558; + } + } + } + } } else { - /* 33222222222211111111110000000000 - 10987654321098765432109876543210 - xx01100111xxxxxxxxxxx1xxxxxxxxxx - stz2g. */ - return 888; + if (((word >> 22) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001101xxxxxxxxxx1xxxxxxxxxx + st2g. */ + return 887; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011001111xxxxxxxxxx1xxxxxxxxxx + stz2g. */ + return 888; + } } } } @@ -16812,19 +17472,679 @@ aarch64_opcode_lookup_1 (uint32_t word) { if (((word >> 22) & 0x1) == 0) { - /* 33222222222211111111110000000000 - 10987654321098765432109876543210 - xxx11101x0xxxxxxxxxxxxxxxxxxxxxx - str. */ - return 892; + if (((word >> 29) & 0x1) == 0) + { + if (((word >> 12) & 0x1) == 0) + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0000xxxxxxxxxxxx + cpyp. */ + return 2559; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0000xxxxxxxxxxxx + cpye. */ + return 2561; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1000xxxxxxxxxxxx + cpyprn. */ + return 2565; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1000xxxxxxxxxxxx + cpyern. */ + return 2567; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0100xxxxxxxxxxxx + cpypwn. */ + return 2562; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0100xxxxxxxxxxxx + cpyewn. */ + return 2564; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1100xxxxxxxxxxxx + cpypn. */ + return 2568; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1100xxxxxxxxxxxx + cpyen. */ + return 2570; + } + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0010xxxxxxxxxxxx + cpyprt. */ + return 2583; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0010xxxxxxxxxxxx + cpyert. */ + return 2585; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1010xxxxxxxxxxxx + cpyprtrn. */ + return 2589; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1010xxxxxxxxxxxx + cpyertrn. */ + return 2591; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0110xxxxxxxxxxxx + cpyprtwn. */ + return 2586; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0110xxxxxxxxxxxx + cpyertwn. */ + return 2588; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1110xxxxxxxxxxxx + cpyprtn. */ + return 2592; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1110xxxxxxxxxxxx + cpyertn. */ + return 2594; + } + } + } + } + } + else + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0001xxxxxxxxxxxx + cpypwt. */ + return 2571; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0001xxxxxxxxxxxx + cpyewt. */ + return 2573; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1001xxxxxxxxxxxx + cpypwtrn. */ + return 2577; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1001xxxxxxxxxxxx + cpyewtrn. */ + return 2579; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0101xxxxxxxxxxxx + cpypwtwn. */ + return 2574; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0101xxxxxxxxxxxx + cpyewtwn. */ + return 2576; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1101xxxxxxxxxxxx + cpypwtn. */ + return 2580; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1101xxxxxxxxxxxx + cpyewtn. */ + return 2582; + } + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0011xxxxxxxxxxxx + cpypt. */ + return 2595; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0011xxxxxxxxxxxx + cpyet. */ + return 2597; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1011xxxxxxxxxxxx + cpyptrn. */ + return 2601; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1011xxxxxxxxxxxx + cpyetrn. */ + return 2603; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx0111xxxxxxxxxxxx + cpyptwn. */ + return 2598; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx0111xxxxxxxxxxxx + cpyetwn. */ + return 2600; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110100xxxxxx1111xxxxxxxxxxxx + cpyptn. */ + return 2604; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110110xxxxxx1111xxxxxxxxxxxx + cpyetn. */ + return 2606; + } + } + } + } + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx111101x0xxxxxxxxxxxxxxxxxxxxxx + str. */ + return 892; + } } else { - /* 33222222222211111111110000000000 - 10987654321098765432109876543210 - xxx11101x1xxxxxxxxxxxxxxxxxxxxxx - ldr. */ - return 893; + if (((word >> 29) & 0x1) == 0) + { + if (((word >> 12) & 0x1) == 0) + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0000xxxxxxxxxxxx + cpym. */ + return 2560; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0000xxxxxxxxxxxx + setgp. */ + return 2619; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx1000xxxxxxxxxxxx + cpymrn. */ + return 2566; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx1000xxxxxxxxxxxx + setge. */ + return 2621; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0100xxxxxxxxxxxx + cpymwn. */ + return 2563; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0100xxxxxxxxxxxx + setgm. */ + return 2620; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011101x1xxxxxx1100xxxxxxxxxxxx + cpymn. */ + return 2569; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0010xxxxxxxxxxxx + cpymrt. */ + return 2584; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0010xxxxxxxxxxxx + setgpn. */ + return 2625; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx1010xxxxxxxxxxxx + cpymrtrn. */ + return 2590; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx1010xxxxxxxxxxxx + setgen. */ + return 2627; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0110xxxxxxxxxxxx + cpymrtwn. */ + return 2587; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0110xxxxxxxxxxxx + setgmn. */ + return 2626; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011101x1xxxxxx1110xxxxxxxxxxxx + cpymrtn. */ + return 2593; + } + } + } + } + else + { + if (((word >> 13) & 0x1) == 0) + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0001xxxxxxxxxxxx + cpymwt. */ + return 2572; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0001xxxxxxxxxxxx + setgpt. */ + return 2622; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx1001xxxxxxxxxxxx + cpymwtrn. */ + return 2578; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx1001xxxxxxxxxxxx + setget. */ + return 2624; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0101xxxxxxxxxxxx + cpymwtwn. */ + return 2575; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0101xxxxxxxxxxxx + setgmt. */ + return 2623; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011101x1xxxxxx1101xxxxxxxxxxxx + cpymwtn. */ + return 2581; + } + } + } + else + { + if (((word >> 14) & 0x1) == 0) + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0011xxxxxxxxxxxx + cpymt. */ + return 2596; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0011xxxxxxxxxxxx + setgptn. */ + return 2628; + } + } + else + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx1011xxxxxxxxxxxx + cpymtrn. */ + return 2602; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx1011xxxxxxxxxxxx + setgetn. */ + return 2630; + } + } + } + else + { + if (((word >> 15) & 0x1) == 0) + { + if (((word >> 23) & 0x1) == 0) + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110101xxxxxx0111xxxxxxxxxxxx + cpymtwn. */ + return 2599; + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx01110111xxxxxx0111xxxxxxxxxxxx + setgmtn. */ + return 2629; + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx011101x1xxxxxx1111xxxxxxxxxxxx + cpymtn. */ + return 2605; + } + } + } + } + } + else + { + /* 33222222222211111111110000000000 + 10987654321098765432109876543210 + xx111101x1xxxxxxxxxxxxxxxxxxxxxx + ldr. */ + return 893; + } } } } @@ -24638,6 +25958,10 @@ aarch64_extract_operand (const aarch64_operand *self, return aarch64_ext_sme_sm_za (self, info, code, inst, errors); case 220: return aarch64_ext_sme_pred_reg_with_index (self, info, code, inst, errors); + case 223: + case 224: + case 225: + return aarch64_ext_x0_to_x30 (self, info, code, inst, errors); default: assert (0); abort (); } } diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c index 46d602d..8e6123d 100644 --- a/opcodes/aarch64-dis.c +++ b/opcodes/aarch64-dis.c @@ -2053,6 +2053,17 @@ aarch64_ext_sve_shrimm (const aarch64_operand *self, info->imm.value = get_top_bit (info->imm.value) * 2 - info->imm.value; return true; } + +/* Decode X0-X30. Register 31 is unallocated. */ +bool +aarch64_ext_x0_to_x30 (const aarch64_operand *self, aarch64_opnd_info *info, + const aarch64_insn code, + const aarch64_inst *inst ATTRIBUTE_UNUSED, + aarch64_operand_error *errors ATTRIBUTE_UNUSED) +{ + info->reg.regno = extract_field (self->fields[0], code, 0); + return info->reg.regno <= 30; +} /* Bitfields that are commonly used to encode certain operands' information may be partially used as part of the base opcode in some instructions. diff --git a/opcodes/aarch64-dis.h b/opcodes/aarch64-dis.h index df59d22..9174dd9 100644 --- a/opcodes/aarch64-dis.h +++ b/opcodes/aarch64-dis.h @@ -130,6 +130,7 @@ AARCH64_DECL_OPD_EXTRACTOR (ext_sme_sm_za); AARCH64_DECL_OPD_EXTRACTOR (ext_sme_pred_reg_with_index); AARCH64_DECL_OPD_EXTRACTOR (ext_imm_rotate1); AARCH64_DECL_OPD_EXTRACTOR (ext_imm_rotate2); +AARCH64_DECL_OPD_EXTRACTOR (ext_x0_to_x30); #undef AARCH64_DECL_OPD_EXTRACTOR diff --git a/opcodes/aarch64-opc-2.c b/opcodes/aarch64-opc-2.c index c583bd0..e0aec42 100644 --- a/opcodes/aarch64-opc-2.c +++ b/opcodes/aarch64-opc-2.c @@ -247,6 +247,9 @@ const struct aarch64_operand aarch64_operands[] = {AARCH64_OPND_CLASS_SVE_REG, "SME_PnT_Wm_imm", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SME_Rm,FLD_SVE_Pn,FLD_SME_i1,FLD_SME_tszh,FLD_SME_tszl}, "Source scalable predicate register with index "}, {AARCH64_OPND_CLASS_IMMEDIATE, "TME_UIMM16", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_imm16}, "a 16-bit unsigned immediate for TME tcancel"}, {AARCH64_OPND_CLASS_SIMD_ELEMENT, "SM3_IMM2", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_SM3_imm2}, "an indexed SM3 vector immediate"}, + {AARCH64_OPND_CLASS_INT_REG, "MOPS_ADDR_Rd", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_Rd}, "a register destination address with writeback"}, + {AARCH64_OPND_CLASS_INT_REG, "MOPS_ADDR_Rs", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_Rs}, "a register source address with writeback"}, + {AARCH64_OPND_CLASS_INT_REG, "MOPS_WB_Rd", OPD_F_HAS_INSERTER | OPD_F_HAS_EXTRACTOR, {FLD_Rn}, "an integer register with writeback"}, {AARCH64_OPND_CLASS_NIL, "", 0, {0}, "DUMMY"}, }; diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index a77070e..cfd4781 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -3921,6 +3921,17 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc, snprintf (buf, size, "%s", opnd->hint_option->name); break; + case AARCH64_OPND_MOPS_ADDR_Rd: + case AARCH64_OPND_MOPS_ADDR_Rs: + snprintf (buf, size, "[%s]!", + get_int_reg_name (opnd->reg.regno, AARCH64_OPND_QLF_X, 0)); + break; + + case AARCH64_OPND_MOPS_WB_Rn: + snprintf (buf, size, "%s!", + get_int_reg_name (opnd->reg.regno, AARCH64_OPND_QLF_X, 0)); + break; + default: snprintf (buf, size, "<invalid>"); break; @@ -5409,6 +5420,36 @@ verify_elem_sd (const struct aarch64_inst *inst, const aarch64_insn insn, return ERR_OK; } +/* Check an instruction that takes three register operands and that + requires the register numbers to be distinct from one another. */ + +static enum err_type +verify_three_different_regs (const struct aarch64_inst *inst, + const aarch64_insn insn ATTRIBUTE_UNUSED, + bfd_vma pc ATTRIBUTE_UNUSED, + bool encoding ATTRIBUTE_UNUSED, + aarch64_operand_error *mismatch_detail + ATTRIBUTE_UNUSED, + aarch64_instr_sequence *insn_sequence + ATTRIBUTE_UNUSED) +{ + int rd, rs, rn; + + rd = inst->operands[0].reg.regno; + rs = inst->operands[1].reg.regno; + rn = inst->operands[2].reg.regno; + if (rd == rs || rd == rn || rs == rn) + { + mismatch_detail->kind = AARCH64_OPDE_SYNTAX_ERROR; + mismatch_detail->error + = _("the three register operands must be distinct from one another"); + mismatch_detail->index = -1; + return ERR_UND; + } + + return ERR_OK; +} + /* Add INST to the end of INSN_SEQUENCE. */ static void diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h index 3c0e990..48d2fa8 100644 --- a/opcodes/aarch64-tbl.h +++ b/opcodes/aarch64-tbl.h @@ -2493,6 +2493,10 @@ static const aarch64_feature_set aarch64_feature_ls64 = AARCH64_FEATURE (AARCH64_FEATURE_V8_6 | AARCH64_FEATURE_LS64, 0); static const aarch64_feature_set aarch64_feature_flagm = AARCH64_FEATURE (AARCH64_FEATURE_FLAGM, 0); +static const aarch64_feature_set aarch64_feature_mops = + AARCH64_FEATURE (AARCH64_FEATURE_MOPS, 0); +static const aarch64_feature_set aarch64_feature_mops_memtag = + AARCH64_FEATURE (AARCH64_FEATURE_MOPS | AARCH64_FEATURE_MEMTAG, 0); #define CORE &aarch64_feature_v8 #define FP &aarch64_feature_fp @@ -2544,6 +2548,8 @@ static const aarch64_feature_set aarch64_feature_flagm = #define ARMV8_7 &aarch64_feature_v8_7 #define LS64 &aarch64_feature_ls64 #define FLAGM &aarch64_feature_flagm +#define MOPS &aarch64_feature_mops +#define MOPS_MEMTAG &aarch64_feature_mops_memtag #define CORE_INSN(NAME,OPCODE,MASK,CLASS,OP,OPS,QUALS,FLAGS) \ { NAME, OPCODE, MASK, CLASS, OP, CORE, OPS, QUALS, FLAGS, 0, 0, NULL } @@ -2669,6 +2675,52 @@ static const aarch64_feature_set aarch64_feature_flagm = { NAME, OPCODE, MASK, CLASS, 0, LS64, OPS, QUALS, FLAGS, 0, 0, NULL } #define FLAGM_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \ { NAME, OPCODE, MASK, CLASS, 0, FLAGM, OPS, QUALS, FLAGS, 0, 0, NULL } +#define MOPS_INSN(NAME, OPCODE, MASK, CLASS, OPS, QUALS, FLAGS, CONSTRAINTS, VERIFIER) \ + { NAME, OPCODE, MASK, CLASS, 0, MOPS, OPS, QUALS, FLAGS, CONSTRAINTS, \ + 0, VERIFIER } +#define MOPS_MEMTAG_INSN(NAME, OPCODE, MASK, CLASS, OPS, QUALS, FLAGS, CONSTRAINTS, VERIFIER) \ + { NAME, OPCODE, MASK, CLASS, 0, MOPS_MEMTAG, OPS, QUALS, FLAGS, \ + CONSTRAINTS, 0, VERIFIER } + +#define MOPS_CPY_OP1_OP2_PME_INSN(NAME, OPCODE, MASK, FLAGS, CONSTRAINTS) \ + MOPS_INSN (NAME, OPCODE, MASK, 0, \ + OP3 (MOPS_ADDR_Rd, MOPS_ADDR_Rs, MOPS_WB_Rn), QL_I3SAMEX, \ + FLAGS, CONSTRAINTS, VERIFIER (three_different_regs)) + +#define MOPS_CPY_OP1_OP2_INSN(NAME, SUFFIX, OPCODE, MASK) \ + MOPS_CPY_OP1_OP2_PME_INSN (NAME "p" SUFFIX, OPCODE, MASK, F_SCAN, 0), \ + MOPS_CPY_OP1_OP2_PME_INSN (NAME "m" SUFFIX, OPCODE | 0x400000, MASK, 0, 0), \ + MOPS_CPY_OP1_OP2_PME_INSN (NAME "e" SUFFIX, OPCODE | 0x800000, MASK, 0, 0) + +#define MOPS_CPY_OP1_INSN(NAME, SUFFIX, OPCODE, MASK) \ + MOPS_CPY_OP1_OP2_INSN (NAME, SUFFIX, OPCODE, MASK), \ + MOPS_CPY_OP1_OP2_INSN (NAME, SUFFIX "wn", OPCODE | 0x4000, MASK), \ + MOPS_CPY_OP1_OP2_INSN (NAME, SUFFIX "rn", OPCODE | 0x8000, MASK), \ + MOPS_CPY_OP1_OP2_INSN (NAME, SUFFIX "n", OPCODE | 0xc000, MASK) + +#define MOPS_CPY_INSN(NAME, OPCODE, MASK) \ + MOPS_CPY_OP1_INSN (NAME, "", OPCODE, MASK), \ + MOPS_CPY_OP1_INSN (NAME, "wt", OPCODE | 0x1000, MASK), \ + MOPS_CPY_OP1_INSN (NAME, "rt", OPCODE | 0x2000, MASK), \ + MOPS_CPY_OP1_INSN (NAME, "t", OPCODE | 0x3000, MASK) + +#define MOPS_SET_OP1_OP2_PME_INSN(NAME, OPCODE, MASK, FLAGS, CONSTRAINTS, ISA) \ + ISA (NAME, OPCODE, MASK, 0, \ + OP3 (MOPS_ADDR_Rd, MOPS_WB_Rn, Rm), QL_I3SAMEX, FLAGS, \ + CONSTRAINTS, VERIFIER (three_different_regs)) + +#define MOPS_SET_OP1_OP2_INSN(NAME, SUFFIX, OPCODE, MASK, ISA) \ + MOPS_SET_OP1_OP2_PME_INSN (NAME "p" SUFFIX, OPCODE, MASK, 0, 0, ISA), \ + MOPS_SET_OP1_OP2_PME_INSN (NAME "m" SUFFIX, OPCODE | 0x4000, MASK, \ + 0, 0, ISA), \ + MOPS_SET_OP1_OP2_PME_INSN (NAME "e" SUFFIX, OPCODE | 0x8000, MASK, \ + 0, 0, ISA) + +#define MOPS_SET_INSN(NAME, OPCODE, MASK, ISA) \ + MOPS_SET_OP1_OP2_INSN (NAME, "", OPCODE, MASK, ISA), \ + MOPS_SET_OP1_OP2_INSN (NAME, "t", OPCODE | 0x1000, MASK, ISA), \ + MOPS_SET_OP1_OP2_INSN (NAME, "n", OPCODE | 0x2000, MASK, ISA), \ + MOPS_SET_OP1_OP2_INSN (NAME, "tn", OPCODE | 0x3000, MASK, ISA) const struct aarch64_opcode aarch64_opcode_table[] = { @@ -5312,6 +5364,51 @@ const struct aarch64_opcode aarch64_opcode_table[] = BFLOAT16_INSN ("bfmlalb", 0x2ec0fc00, 0xffe0fc00, bfloat16, OP3 (Vd, Vn, Vm), QL_BFMMLA, 0), BFLOAT16_INSN ("bfmlalt", 0x4fc0f000, 0xffc0f400, bfloat16, OP3 (Vd, Vn, Em16), QL_V3BFML4S, 0), BFLOAT16_INSN ("bfmlalb", 0x0fc0f000, 0xffc0f400, bfloat16, OP3 (Vd, Vn, Em16), QL_V3BFML4S, 0), + + /* cpyfp cpyfprn cpyfpwn cpyfpn + cpyfm cpyfmrn cpyfmwn cpyfmn + cpyfe cpyfern cpyfewn cpyfen + + cpyfprt cpyfprtrn cpyfprtwn cpyfprtn + cpyfmrt cpyfmrtrn cpyfmrtwn cpyfmrtn + cpyfert cpyfertrn cpyfertwn cpyfertn + + cpyfpwt cpyfpwtrn cpyfpwtwn cpyfpwtn + cpyfmwt cpyfmwtrn cpyfmwtwn cpyfmwtn + cpyfewt cpyfewtrn cpyfewtwn cpyfewtn + + cpyfpt cpyfptrn cpyfptwn cpyfptn + cpyfmt cpyfmtrn cpyfmtwn cpyfmtn + cpyfet cpyfetrn cpyfetwn cpyfetn. */ + MOPS_CPY_INSN ("cpyf", 0x19000400, 0xffe0fc00), + + /* cpyp cpyprn cpypwn cpypn + cpym cpymrn cpymwn cpymn + cpye cpyern cpyewn cpyen + + cpyprt cpyprtrn cpyprtwn cpyprtn + cpymrt cpymrtrn cpymrtwn cpymrtn + cpyert cpyertrn cpyertwn cpyertn + + cpypwt cpypwtrn cpypwtwn cpypwtn + cpymwt cpymwtrn cpymwtwn cpymwtn + cpyewt cpyewtrn cpyewtwn cpyewtn + + cpypt cpyptrn cpyptwn cpyptn + cpymt cpymtrn cpymtwn cpymtn + cpyet cpyetrn cpyetwn cpyetn. */ + MOPS_CPY_INSN ("cpy", 0x1d000400, 0xffe0fc00), + + /* setp setpt setpn setptn + setm setmt setmn setmtn + sete setet seten setetn */ + MOPS_SET_INSN ("set", 0x19c00400, 0xffe0fc00, MOPS_INSN), + + /* setgp setgpt setgpn setgptn + setgm setgmt setgmn setgmtn + setge setget setgen setgetn */ + MOPS_SET_INSN ("setg", 0x1dc00400, 0xffe0fc00, MOPS_MEMTAG_INSN), + {0, 0, 0, 0, 0, 0, {}, {}, 0, 0, 0, NULL}, }; @@ -5795,4 +5892,12 @@ const struct aarch64_opcode aarch64_opcode_table[] = Y(IMMEDIATE, imm, "TME_UIMM16", 0, F(FLD_imm16), \ "a 16-bit unsigned immediate for TME tcancel") \ Y(SIMD_ELEMENT, reglane, "SM3_IMM2", 0, F(FLD_SM3_imm2), \ - "an indexed SM3 vector immediate") + "an indexed SM3 vector immediate") \ + /* These next two are really register fields; the [...] notation \ + is just syntactic sugar. */ \ + Y(INT_REG, x0_to_x30, "MOPS_ADDR_Rd", 0, F(FLD_Rd), \ + "a register destination address with writeback") \ + Y(INT_REG, x0_to_x30, "MOPS_ADDR_Rs", 0, F(FLD_Rs), \ + "a register source address with writeback") \ + Y(INT_REG, x0_to_x30, "MOPS_WB_Rd", 0, F(FLD_Rn), \ + "an integer register with writeback") |