]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[ARM] Add support for ARMv8.1 PAN extension
authorMatthew Wahab <matthew.wahab@arm.com>
Tue, 2 Jun 2015 11:30:38 +0000 (12:30 +0100)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 24 Aug 2017 12:20:01 +0000 (09:20 -0300)
Change-Id: I2fdfcca78ffa4acc26854429ccd7b939ef3819d9

gas/ChangeLog
gas/config/tc-arm.c
gas/doc/c-arm.texi
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/armv8-a+pan.d [new file with mode: 0644]
gas/testsuite/gas/arm/armv8-a+pan.s [new file with mode: 0644]
include/opcode/arm.h
opcodes/ChangeLog
opcodes/arm-dis.c

index 0b93dbf1e29953d4193447b5724842bde4475925..e7e86c82ec4e2f1d57d401f90d1173c81b95f31e 100644 (file)
        (arm_cpus): Likewise.
        (arm_extensions): Likewise.
 
+2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
+
+       * config/tc-arm.c (arm_ext_pan): New.
+       (do_setpan): New, encode an ARM SETPAN instruction.
+       (do_t_setpan): New, encode a Thumb SETPAN instruction.
+       (insns): Add "setpan".
+       (arm_extensions): Add "pan".
+       * doc/c-arm.texi (ARM Options): Add "pan" to list of -mcpu processor
+       extensions.
+
 2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
 
        * config/tc-aarch64.c (aarch64_features): Add "rdma".
index 76c1549f9b0a62952ad321bb915406d6f2c83193..b363195801be5eb4e1719f7e1a1246a753e56af2 100644 (file)
@@ -207,6 +207,7 @@ static const arm_feature_set arm_ext_sec = ARM_FEATURE_CORE_LOW (ARM_EXT_SEC);
 static const arm_feature_set arm_ext_os = ARM_FEATURE_CORE_LOW (ARM_EXT_OS);
 static const arm_feature_set arm_ext_adiv = ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV);
 static const arm_feature_set arm_ext_virt = ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT);
+static const arm_feature_set arm_ext_pan = ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN);
 
 static const arm_feature_set arm_arch_any = ARM_ANY;
 static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1, -1);
@@ -9168,6 +9169,24 @@ do_swi (void)
   inst.reloc.pc_rel = 0;
 }
 
+static void
+do_setpan (void)
+{
+  constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_pan),
+             _("selected processor does not support SETPAN instruction"));
+
+  inst.instruction |= ((inst.operands[0].imm & 1) << 9);
+}
+
+static void
+do_t_setpan (void)
+{
+  constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_pan),
+             _("selected processor does not support SETPAN instruction"));
+
+  inst.instruction |= (inst.operands[0].imm << 3);
+}
+
 /* ARM V5E (El Segundo) signed-multiply-accumulate (argument parse)
    SMLAxy{cond} Rd,Rm,Rs,Rn
    SMLAWy{cond} Rd,Rm,Rs,Rn
@@ -18836,6 +18855,13 @@ static const struct asm_opcode insns[] =
  TCE("hvc",    1400070, f7e08000, 1, (EXPi), hvc, t_hvc),
  TCE("eret",   160006e, f3de8f00, 0, (), noargs, noargs),
 
+#undef ARM_VARIANT
+#define        ARM_VARIANT    & arm_ext_pan
+#undef THUMB_VARIANT
+#define        THUMB_VARIANT  & arm_ext_pan
+
+ TUF("setpan", 1100000, b610, 1, (I7), setpan, t_setpan),
+
 #undef  ARM_VARIANT
 #define ARM_VARIANT    & arm_ext_v6t2
 #undef  THUMB_VARIANT
@@ -24545,6 +24571,9 @@ static const struct arm_option_extension_value_table arm_extensions[] =
   ARM_EXT_OPT ("os",   ARM_FEATURE_CORE_LOW (ARM_EXT_OS),
                        ARM_FEATURE_CORE_LOW (ARM_EXT_OS),
                                   ARM_FEATURE_CORE_LOW (ARM_EXT_V6M)),
+  ARM_EXT_OPT ("pan",  ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN),
+                       ARM_FEATURE (ARM_EXT_V8, ARM_EXT2_PAN, 0),
+                       ARM_FEATURE_CORE_LOW (ARM_EXT_V8)),
   ARM_EXT_OPT ("sec",  ARM_FEATURE_CORE_LOW (ARM_EXT_SEC),
                        ARM_FEATURE_CORE_LOW (ARM_EXT_SEC),
                                   ARM_FEATURE_CORE_LOW (ARM_EXT_V6K | ARM_EXT_V7A)),
index 7bcce943d10e71c5e46d120ce418d01107e561bc..9f4c8c1d87ad19767ab4578f201b815b61d393e4 100644 (file)
@@ -167,6 +167,7 @@ The following extensions are currently supported:
 @code{simd} (Advanced SIMD Extensions for v8-A architecture, implies @code{fp}),
 @code{virt} (Virtualization Extensions for v7-A architecture, implies
 @code{idiv}),
+@code{pan} (Priviliged Access Never Extensions for v8-A architecture)
 and
 @code{xscale}.
 
index 430fa35917db58ec4b9d6d5cd3a9413ff51dd7f2..166c0027a57c40af2490c6079802fa2bb3cbefc7 100644 (file)
@@ -1,20 +1,25 @@
 2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
 
-       * rdma-directive.d: New.
-       * rdma.d: New.
-       * rdma.s: New.
+       * gas/arm/armv8-a+pan.d: New.
+       * gas/arm/armv8-a+pan.s: New.
 
 2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
 
-       * lor-directive.d: New.
-       * lor.d: New.
-       * lor.s: New
+       * gas/aarch64/rdma-directive.d: New.
+       * gas/aarch64/rdma.d: New.
+       * gas/aarch64/rdma.s: New.
+
+2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
+
+       * gas/aarch64/lor-directive.d: New.
+       * gas/aarch64/lor.d: New.
+       * gas/aarch64/lor.s: New
 
 2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>
 
-       * pan-directive.d: New.
-       * pan.d: New.
-       * pan.s: New
+       * gas/aarch64/pan-directive.d: New.
+       * gas/aarch64/pan.d: New.
+       * gas/aarch64/pan.s: New
 
 2014-11-18  Jan Beulich  <jbeulich@suse.com>
 
diff --git a/gas/testsuite/gas/arm/armv8-a+pan.d b/gas/testsuite/gas/arm/armv8-a+pan.d
new file mode 100644 (file)
index 0000000..2005260
--- /dev/null
@@ -0,0 +1,11 @@
+#name: Valid v8-a+pan
+#objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+
+Disassembly of section .text:
+0[0-9a-f]+ <.*> f1100000       setpan  #0
+0[0-9a-f]+ <.*> f1100200       setpan  #1
+0[0-9a-f]+ <.*> b610           setpan  #0
+0[0-9a-f]+ <.*> b618           setpan  #1
\ No newline at end of file
diff --git a/gas/testsuite/gas/arm/armv8-a+pan.s b/gas/testsuite/gas/arm/armv8-a+pan.s
new file mode 100644 (file)
index 0000000..f2ed60b
--- /dev/null
@@ -0,0 +1,14 @@
+       .syntax unified
+       .arch armv8-a
+       .arch_extension pan
+
+A1:     
+       .arm
+        setpan #0
+        setpan #1
+
+T1:     
+        .thumb
+        setpan #0
+        setpan #1
+
index 148a0d8420c72608e0edd06c8d1f960a8a05c680..205b402d828e09de689da02c32df059cee4d6ba7 100644 (file)
@@ -57,6 +57,8 @@
                                           state.  */
 #define ARM_EXT_VIRT    0x80000000     /* Virtualization extensions.  */
 
+#define ARM_EXT2_PAN    0x00000001     /* PAN extension.  */
+
 /* Co-processor space extensions.  */
 #define ARM_CEXT_XSCALE   0x00000001   /* Allow MIA etc.          */
 #define ARM_CEXT_MAVERICK 0x00000002   /* Use Cirrus/DSP coprocessor.  */
@@ -318,5 +320,6 @@ typedef struct
 
 #define ARM_FEATURE_LOW(core, coproc) {{(core), 0}, (coproc)}
 #define ARM_FEATURE_CORE_LOW(core) {{(core), 0}, 0}
+#define ARM_FEATURE_CORE_HIGH(core) {{0, (core)}, 0}
 #define ARM_FEATURE_COPROC(coproc) {{0, 0}, (coproc)}
 #define ARM_FEATURE(core1, core2, coproc) {{(core1), (core2)}, (coproc)}
index a678d488f36bc2f578926d66fad0b23fad0a2caf..46b1e937a5a7a9da31c4746a300027311f4da683 100644 (file)
        (print_insn_arm): Likewise.
        (select_arm_features): Follow new feature struct.
 
+2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
+
+       * arm-dis.c (arm_opcodes): Add "setpan".
+       (thumb_opcodes): Add "setpan".
+
 2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
 
        * arm-dis.c (select_arm_features): Rework to avoid used of redefined
index 619e11c1fd3d4c3be74939d6c0bbfb95f6967266..9d6190b8ebbd0622649a030013cb88e1570ea26a 100644 (file)
@@ -1602,6 +1602,10 @@ static const struct opcode32 arm_opcodes[] =
   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
     0xe1400240, 0xfff00ff0, "crc32cw\t%12-15R, %16-19R, %0-3R"},
 
+  /* Privileged Access Never extension instructions.  */
+  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN),
+    0xf1100000, 0xfffffdff, "setpan\t#%9-9d"},
+
   /* Virtualization Extension instructions.  */
   {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0x0160006e, 0x0fffffff, "eret%c"},
   {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0x01400070, 0x0ff000f0, "hvc%c\t%e"},
@@ -2293,6 +2297,7 @@ static const struct opcode16 thumb_opcodes[] =
   /* ARM V8 instructions.  */
   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),  0xbf50, 0xffff, "sevl%c"},
   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),  0xba80, 0xffc0, "hlt\t%0-5x"},
+  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN),  0xb610, 0xfff7, "setpan\t#%3-3d"},
 
   /* ARM V6K no-argument instructions.  */
   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf00, 0xffff, "nop%c"},