From: Andrea Corallo Date: Wed, 19 May 2021 13:04:24 +0000 (+0200) Subject: PATCH [7/10] arm: add 'bxaut' instruction for Armv8.1-M pacbti extension X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e07352fa4fb419b44979da21c635e4d79f7773c7;p=binutils-gdb.git PATCH [7/10] arm: add 'bxaut' instruction for Armv8.1-M pacbti extension gas/ 2021-06-11 Andrea Corallo * config/tc-arm.c (T16_32_TAB): Add '_bxaut'. (do_t_pacbti_nonop): New function. (insns): Define 'bxaut' insn. * testsuite/gas/arm/armv8_1-m-pacbti.d: Add 'bxaut' test. * testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise. opcodes/ 2021-06-11 Andrea Corallo * arm-dis.c (thumb32_opcodes): Add 'bxaut'. --- diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 3ec353abf78..30ef1991249 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -11463,6 +11463,7 @@ encode_thumb32_addr_mode (int i, bool is_t, bool is_d) X(_bflx, 0000, f070e001), \ X(_bic, 4380, ea200000), \ X(_bics, 4380, ea300000), \ + X(_bxaut, 0000, fb500f10), \ X(_cinc, 0000, ea509000), \ X(_cinv, 0000, ea50a000), \ X(_cmn, 42c0, eb100f00), \ @@ -22343,6 +22344,18 @@ do_t_pacbti (void) inst.instruction = THUMB_OP32 (inst.instruction); } +static void +do_t_pacbti_nonop (void) +{ + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, pacbti_ext), + _(BAD_PACBTI)); + + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; +} + /* Overall per-instruction processing. */ @@ -26333,6 +26346,7 @@ static const struct asm_opcode insns[] = #define THUMB_VARIANT & arm_ext_v8_1m_main toU("aut", _aut, 3, (R12, LR, SP), t_pacbti), ToU("bti", f3af800f, 0, (), noargs), + toU("bxaut", _bxaut, 3, (RR, RR, RR), t_pacbti_nonop), toU("pac", _pac, 3, (R12, LR, SP), t_pacbti), toU("pacbti", _pacbti, 3, (R12, LR, SP), t_pacbti), toU("cinc", _cinc, 3, (RRnpcsp, RR_ZR, COND), t_cond), diff --git a/gas/testsuite/gas/arm/armv8_1-m-pacbti.d b/gas/testsuite/gas/arm/armv8_1-m-pacbti.d index 9df123af8eb..411454a5fd1 100644 --- a/gas/testsuite/gas/arm/armv8_1-m-pacbti.d +++ b/gas/testsuite/gas/arm/armv8_1-m-pacbti.d @@ -1,6 +1,6 @@ #name: Valid Armv8.1-M pointer authentication and branch target identification extention #source: armv8_1-m-pacbti.s -#as: -march=armv8.1-m.main +#as: -march=armv8.1-m.main+pacbti #objdump: -dr --prefix-addresses --show-raw-insn .*: +file format .*arm.* @@ -10,4 +10,5 @@ Disassembly of section .text: 0[0-9a-f]+ <[^>]+> f3af 800d pacbti r12, lr, sp 0[0-9a-f]+ <[^>]+> f3af 802d aut r12, lr, sp 0[0-9a-f]+ <[^>]+> f3af 801d pac r12, lr, sp +0[0-9a-f]+ <[^>]+> fb54 3f15 bxaut r3, r4, r5 #... diff --git a/gas/testsuite/gas/arm/armv8_1-m-pacbti.s b/gas/testsuite/gas/arm/armv8_1-m-pacbti.s index 38000c3fc0d..22da2cefb4e 100644 --- a/gas/testsuite/gas/arm/armv8_1-m-pacbti.s +++ b/gas/testsuite/gas/arm/armv8_1-m-pacbti.s @@ -6,3 +6,4 @@ pacbti r12, lr, sp aut r12, lr, sp pac r12, lr, sp + bxaut r3, r4, r5 diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 930fbbfa385..1d183605030 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -4658,6 +4658,8 @@ static const struct opcode32 thumb32_opcodes[] = 0xf3af802d, 0xffffffff, "aut\tr12, lr, sp"}, {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN), 0xf3af800f, 0xffffffff, "bti"}, + {ARM_FEATURE_CORE_HIGH_HIGH (ARM_EXT3_PACBTI), + 0xfb500f10, 0xfff00ff0, "bxaut%c\t%12-15r, %16-19r, %0-3r"}, {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN), 0xf3af801d, 0xffffffff, "pac\tr12, lr, sp"}, {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),