PATCH [1/10] arm: add 'bti' instruction for Armv8.1-M pacbti extension
authorAndrea Corallo <andrea.corallo@arm.com>
Fri, 14 May 2021 14:19:39 +0000 (16:19 +0200)
committerAndrea Corallo <andrea.corallo@arm.com>
Mon, 26 Jul 2021 12:18:24 +0000 (14:18 +0200)
gas/
2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

* config/tc-arm.c (insns): Add 'bti' insn.
* testsuite/gas/arm/armv8_1-m-pacbti.d: New file.
* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

opcodes/
2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

* arm-dis.c (thumb32_opcodes): Add bti instruction.

gas/config/tc-arm.c
gas/testsuite/gas/arm/armv8_1-m-pacbti.d [new file with mode: 0644]
gas/testsuite/gas/arm/armv8_1-m-pacbti.s [new file with mode: 0644]
opcodes/arm-dis.c

index fa023b4461eb5240dad2078a7c54e551afb84c9e..d7f8fca803ba479344c37650a38d4a532b8ae634 100644 (file)
@@ -26305,6 +26305,7 @@ static const struct asm_opcode insns[] =
  /* Armv8.1-M Mainline instructions.  */
 #undef  THUMB_VARIANT
 #define THUMB_VARIANT & arm_ext_v8_1m_main
+ ToU("bti",   f3af800f, 0, (), noargs),
  toU("cinc",  _cinc,  3, (RRnpcsp, RR_ZR, COND),       t_cond),
  toU("cinv",  _cinv,  3, (RRnpcsp, RR_ZR, COND),       t_cond),
  toU("cneg",  _cneg,  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
new file mode 100644 (file)
index 0000000..3c69372
--- /dev/null
@@ -0,0 +1,10 @@
+#name: Valid Armv8.1-M pointer authentication and branch target identification extention
+#source: armv8_1-m-pacbti.s
+#as: -march=armv8.1-m.main
+#objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> f3af 800f   bti
+#...
diff --git a/gas/testsuite/gas/arm/armv8_1-m-pacbti.s b/gas/testsuite/gas/arm/armv8_1-m-pacbti.s
new file mode 100644 (file)
index 0000000..38929e3
--- /dev/null
@@ -0,0 +1,5 @@
+       .syntax unified
+       .text
+       .thumb
+.Lstart:
+       bti
index 92cd098d6c9afe664fbfeeba70f4428c366baf87..1e0969975438e8f9b4af99781a885178325dfc21 100644 (file)
@@ -4652,6 +4652,11 @@ static const struct opcode16 thumb_opcodes[] =
    makes heavy use of special-case bit patterns.  */
 static const struct opcode32 thumb32_opcodes[] =
 {
+  /* Arm v8.1-M Mainline Pointer Authentication and Branch Target
+     Identification Extension.  */
+  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
+   0xf3af800f, 0xffffffff, "bti"},
+
   /* Armv8.1-M Mainline and Armv8.1-M Mainline Security Extensions
      instructions.  */
   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),