[Aarch64] Support an ARMv8.2 system register.
authorMatthew Wahab <matthew.wahab@arm.com>
Fri, 27 Nov 2015 13:44:10 +0000 (13:44 +0000)
committerMatthew Wahab <matthew.wahab@arm.com>
Fri, 27 Nov 2015 13:44:10 +0000 (13:44 +0000)
ARMv8.2 adds a new system register id_aa64mmfr2_el1. This patch adds
support for the register to binutils, making it available when
-march=armv8.2-a is selected.

opcodes/
2015-11-27  Matthew Wahab  <matthew.wahab@arm.com>

* aarch64-opc.c (aarch64_sys_regs): Add "id_aa64mmfr2_el1".
(aarch64_sys_reg_supported_p): Add ARMv8.2 system register
feature test.

gas/testsuite/
2015-11-27  Matthew Wahab  <matthew.wahab@arm.com>

* gas/aarch64/sysreg-2.d: New.
* gas/aarch64/sysreg-2.s: New.

Change-Id: I767f18a60e2bd70ce74c89f6abfe07afdc9e601f

gas/testsuite/ChangeLog
gas/testsuite/gas/aarch64/sysreg-2.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/sysreg-2.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/aarch64-opc.c

index aae4691ecb39028a43bc8056e733e4745a612d82..faf5282f36f0431d0356e0ae385d8af6d85a47e0 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-27  Matthew Wahab  <matthew.wahab@arm.com>
+
+       * gas/aarch64/sysreg-2.d: New.
+       * gas/aarch64/sysreg-2.s: New.
+
 2015-11-24  Christophe Monat <christophe.monat@st.com>
 
        * gas/arm/thumb2_ldr_immediate_armv6t2.s: Added high register
diff --git a/gas/testsuite/gas/aarch64/sysreg-2.d b/gas/testsuite/gas/aarch64/sysreg-2.d
new file mode 100644 (file)
index 0000000..f0fe533
--- /dev/null
@@ -0,0 +1,11 @@
+#objdump: -dr
+#as: -march=armv8.2-a
+
+.*:     file .*
+
+
+Disassembly of section .text:
+
+0000000000000000 <.*>:
+   [0-9a-f]+:  d5380725        mrs     x5, id_aa64mmfr1_el1
+   [0-9a-f]+:  d5380747        mrs     x7, id_aa64mmfr2_el1
diff --git a/gas/testsuite/gas/aarch64/sysreg-2.s b/gas/testsuite/gas/aarch64/sysreg-2.s
new file mode 100644 (file)
index 0000000..f519682
--- /dev/null
@@ -0,0 +1,15 @@
+/* sysreg-2.s Test file for ARMv8.2 system registers.  */
+
+       .macro rw_sys_reg sys_reg xreg r w
+       .ifc \w, 1
+       msr \sys_reg, \xreg
+       .endif
+       .ifc \r, 1
+       mrs \xreg, \sys_reg
+       .endif
+       .endm
+
+       .text
+
+       rw_sys_reg sys_reg=id_aa64mmfr1_el1 xreg=x5 r=1 w=0
+       rw_sys_reg sys_reg=id_aa64mmfr2_el1 xreg=x7 r=1 w=0
index 08f0c1b75162a2a85c3637b5ddd91c3cbefb1800..d773eece4ddd4f9c5b9a4e5eec3cf3699402c13d 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-27  Matthew Wahab  <matthew.wahab@arm.com>
+
+       * aarch64-opc.c (aarch64_sys_regs): Add "id_aa64mmfr2_el1".
+       (aarch64_sys_reg_supported_p): Add ARMv8.2 system register
+       feature test.
+
 2015-11-23  Tristan Gingold  <gingold@adacore.com>
 
        * arm-dis.c (print_insn): Also set is_thumb for Mach-O.
index a19f36fede6cfdc19940cc050079494fecc8b270..9323217f3327ad8e9b80444857df85498c289fb7 100644 (file)
@@ -2801,6 +2801,7 @@ const aarch64_sys_reg aarch64_sys_regs [] =
   { "id_aa64isar1_el1", CPENC(3,0,C0,C6,1),    0 }, /* RO */
   { "id_aa64mmfr0_el1", CPENC(3,0,C0,C7,0),    0 }, /* RO */
   { "id_aa64mmfr1_el1", CPENC(3,0,C0,C7,1),    0 }, /* RO */
+  { "id_aa64mmfr2_el1", CPENC (3, 0, C0, C7, 2), F_ARCHEXT }, /* RO */
   { "id_aa64afr0_el1",  CPENC(3,0,C0,C5,4),    0 }, /* RO */
   { "id_aa64afr1_el1",  CPENC(3,0,C0,C5,5),    0 }, /* RO */
   { "clidr_el1",        CPENC(3,1,C0,C0,1),    0 }, /* RO */
@@ -3135,6 +3136,10 @@ aarch64_sys_reg_supported_p (const aarch64_feature_set features,
        || reg->value == CPENC (3, 5, C14, C3, 1)
        || reg->value == CPENC (3, 5, C14, C3, 2))
       && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_V8_1))
+
+  /* ARMv8.2 features.  */
+  if (reg->value == CPENC (3, 0, C0, C7, 2)
+      && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_V8_2))
     return FALSE;
 
   return TRUE;