aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMatthew Wahab <matthew.wahab@arm.com>2015-06-02 12:30:38 +0100
committerJiong Wang <jiong.wang@arm.com>2015-06-02 12:30:38 +0100
commitddfded2f7bba485d6c967b502337a72310f24913 (patch)
treedf248162b8426a8e6d86559f1ac1cc4287cf4fea /gas
parent1af1dd51db991700c0e66b35d777a44e6953bbd2 (diff)
downloadgdb-ddfded2f7bba485d6c967b502337a72310f24913.zip
gdb-ddfded2f7bba485d6c967b502337a72310f24913.tar.gz
gdb-ddfded2f7bba485d6c967b502337a72310f24913.tar.bz2
[ARM] Add support for ARMv8.1 PAN extension
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/tc-arm.c29
-rw-r--r--gas/doc/c-arm.texi1
-rw-r--r--gas/testsuite/ChangeLog23
-rw-r--r--gas/testsuite/gas/arm/armv8-a+pan.d11
-rw-r--r--gas/testsuite/gas/arm/armv8-a+pan.s14
6 files changed, 79 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index aa7195e..eb3fcca 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,15 @@
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".
* doc/c-aarch64.texi (AArch64 Extensions): Add "rdma".
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 683774f..ece5ebc 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -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);
@@ -9181,6 +9182,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
@@ -18884,6 +18903,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
@@ -24662,6 +24688,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)),
diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi
index d31ba02..85ff20d 100644
--- a/gas/doc/c-arm.texi
+++ b/gas/doc/c-arm.texi
@@ -179,6 +179,7 @@ architectures),
@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}.
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 2e45237..60d9126 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -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
2015-06-01 Jiong Wang <jiong.wang@arm.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
index 0000000..2005260
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8-a+pan.d
@@ -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
index 0000000..f2ed60b
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8-a+pan.s
@@ -0,0 +1,14 @@
+ .syntax unified
+ .arch armv8-a
+ .arch_extension pan
+
+A1:
+ .arm
+ setpan #0
+ setpan #1
+
+T1:
+ .thumb
+ setpan #0
+ setpan #1
+