]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[AArch64][Patch 2/5] Add Statistical Profiling Extension system registers.
authorMatthew Wahab <matthew.wahab@arm.com>
Fri, 11 Dec 2015 09:52:11 +0000 (09:52 +0000)
committerMatthew Wahab <matthew.wahab@arm.com>
Fri, 11 Dec 2015 09:52:11 +0000 (09:52 +0000)
The Statistical Profile extension included in the ARMv8.2 architecture
adds a number of system registers. This patch adds the registers to
binutils, making them available when the architecture extension
"+profile" is enabled.

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

* aarch64-opc.c (aarch64_sys_reg): Add pbmlimitr_el1, pmbptr_el1,
pmbsr_el1, pmbidr_el1, pmscr_el1, pmsicr_el1, pmsirr_el1,
pmsfcr_el1, pmsevfr_el1, pmslatfr_el1, pmsidr_el1, pmscr_el2 and
pmscr_el2.
(aarch64_sys_reg_supported_p): Add architecture feature tests for
the new registers.

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

* gas/aarch64/sysreg-2.s: Add tests for the statistical profiling
system registers.
* gas/aarch64/sysreg-2.d: Enable the statistical profiling
extension and update the expected output.

Change-Id: Ibf23ad34db7c33f0fcd30010b796748b38be6efb

gas/testsuite/ChangeLog
gas/testsuite/gas/aarch64/sysreg-2.d
gas/testsuite/gas/aarch64/sysreg-2.s
opcodes/ChangeLog
opcodes/aarch64-opc.c

index 4027a7c890bc49288edecd512f1f6b60a80a4fd9..dafa360a3f9c042df626fb0eb76932417dfee3fd 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-11  Matthew Wahab  <matthew.wahab@arm.com>
+
+       * gas/aarch64/sysreg-2.s: Add tests for the statistical profiling
+       system registers.
+       * gas/aarch64/sysreg-2.d: Enable the statistical profiling
+       extension and update the expected output.
+
 2015-12-10  Matthew Wahab  <matthew.wahab@arm.com>
 
        * gas/aarch64/sysreg-2.d: Update for new tests for AT S1E1RP and
index f73412f0dd0d7e13440eaa82254f096c55e47918..ba5fb5279abf8f2da5c8528f658b08240edf44d2 100644 (file)
@@ -1,5 +1,5 @@
 #objdump: -dr
-#as: -march=armv8.2-a
+#as: -march=armv8.2-a+profile
 
 .*:     file .*
 
@@ -32,3 +32,29 @@ Disassembly of section .text:
   [0-9a-f]+:   d50b7c22        dc      cvap, x2
   [0-9a-f]+:   d5087900        at      s1e1rp, x0
   [0-9a-f]+:   d5087921        at      s1e1wp, x1
+  [0-9a-f]+:   d5189a07        msr     pmblimitr_el1, x7
+  [0-9a-f]+:   d5389a07        mrs     x7, pmblimitr_el1
+  [0-9a-f]+:   d5189a27        msr     pmbptr_el1, x7
+  [0-9a-f]+:   d5389a27        mrs     x7, pmbptr_el1
+  [0-9a-f]+:   d5189a67        msr     pmbsr_el1, x7
+  [0-9a-f]+:   d5389a67        mrs     x7, pmbsr_el1
+  [0-9a-f]+:   d5189ae7        msr     pmbidr_el1, x7
+  [0-9a-f]+:   d5389ae7        mrs     x7, pmbidr_el1
+  [0-9a-f]+:   d5189907        msr     pmscr_el1, x7
+  [0-9a-f]+:   d5389907        mrs     x7, pmscr_el1
+  [0-9a-f]+:   d5189947        msr     pmsicr_el1, x7
+  [0-9a-f]+:   d5389947        mrs     x7, pmsicr_el1
+  [0-9a-f]+:   d5189967        msr     pmsirr_el1, x7
+  [0-9a-f]+:   d5389967        mrs     x7, pmsirr_el1
+  [0-9a-f]+:   d5189987        msr     pmsfcr_el1, x7
+  [0-9a-f]+:   d5389987        mrs     x7, pmsfcr_el1
+  [0-9a-f]+:   d51899a7        msr     pmsevfr_el1, x7
+  [0-9a-f]+:   d53899a7        mrs     x7, pmsevfr_el1
+  [0-9a-f]+:   d51899c7        msr     pmslatfr_el1, x7
+  [0-9a-f]+:   d53899c7        mrs     x7, pmslatfr_el1
+  [0-9a-f]+:   d51c9907        msr     pmscr_el2, x7
+  [0-9a-f]+:   d53c9907        mrs     x7, pmscr_el2
+  [0-9a-f]+:   d51d9907        msr     pmscr_el12, x7
+  [0-9a-f]+:   d53d9907        mrs     x7, pmscr_el12
+  [0-9a-f]+:   d5389ae7        mrs     x7, pmbidr_el1
+  [0-9a-f]+:   d53899e7        mrs     x7, pmsidr_el1
index f89d05796921024e3290f7dc1366e312b081b400..2f6ea7066e2bbf307dda7bccda29c5dbfd0b236f 100644 (file)
 
        at s1e1rp, x0
        at s1e1wp, x1
+
+       /* Statistical profiling.  */
+
+       .irp reg, pmblimitr_el1, pmbptr_el1, pmbsr_el1 pmbidr_el1
+       rw_sys_reg sys_reg=\reg xreg=x7 r=1 w=1
+       .endr
+
+       .irp reg, pmscr_el1, pmsicr_el1, pmsirr_el1, pmsfcr_el1
+       rw_sys_reg sys_reg=\reg xreg=x7 r=1 w=1
+       .endr
+
+       .irp reg, pmsevfr_el1, pmslatfr_el1, pmscr_el2, pmscr_el12
+       rw_sys_reg sys_reg=\reg xreg=x7 r=1 w=1
+       .endr
+
+       .irp reg, pmbidr_el1, pmsidr_el1
+       rw_sys_reg sys_reg=\reg xreg=x7 r=1 w=0
+       .endr
index aec423bfab8c2b0c8a9c5133f6c7fbe6afaac9a2..35cdbcfdfd2636066093768040f434dc68221640 100644 (file)
@@ -1,3 +1,12 @@
+2015-12-11  Matthew Wahab  <matthew.wahab@arm.com>
+
+       * aarch64-opc.c (aarch64_sys_reg): Add pbmlimitr_el1, pmbptr_el1,
+       pmbsr_el1, pmbidr_el1, pmscr_el1, pmsicr_el1, pmsirr_el1,
+       pmsfcr_el1, pmsevfr_el1, pmslatfr_el1, pmsidr_el1, pmscr_el2 and
+       pmscr_el2.
+       (aarch64_sys_reg_supported_p): Add architecture feature tests for
+       the new registers.
+
 2015-12-10  Matthew Wahab  <matthew.wahab@arm.com>
 
        * aarch64-opc.c (aarch64_sys_regs_at): Add "s1e1rp" and "s1e1wp".
index b2f772e8b45e5605e8c2848df5ca055cca1f4f09..a75c415cf92e6c3b2788b77de5b80e93044255cf 100644 (file)
@@ -3039,7 +3039,19 @@ const aarch64_sys_reg aarch64_sys_regs [] =
   { "dbgclaimset_el1",   CPENC(2,0,C7, C8, 6), 0 },
   { "dbgclaimclr_el1",   CPENC(2,0,C7, C9, 6), 0 },
   { "dbgauthstatus_el1", CPENC(2,0,C7, C14,6), 0 },  /* r */
-
+  { "pmblimitr_el1",    CPENC (3, 0, C9, C10, 0), F_ARCHEXT },  /* rw */
+  { "pmbptr_el1",       CPENC (3, 0, C9, C10, 1), F_ARCHEXT },  /* rw */
+  { "pmbsr_el1",        CPENC (3, 0, C9, C10, 3), F_ARCHEXT },  /* rw */
+  { "pmbidr_el1",       CPENC (3, 0, C9, C10, 7), F_ARCHEXT },  /* ro */
+  { "pmscr_el1",        CPENC (3, 0, C9, C9, 0),  F_ARCHEXT },  /* rw */
+  { "pmsicr_el1",       CPENC (3, 0, C9, C9, 2),  F_ARCHEXT },  /* rw */
+  { "pmsirr_el1",       CPENC (3, 0, C9, C9, 3),  F_ARCHEXT },  /* rw */
+  { "pmsfcr_el1",       CPENC (3, 0, C9, C9, 4),  F_ARCHEXT },  /* rw */
+  { "pmsevfr_el1",      CPENC (3, 0, C9, C9, 5),  F_ARCHEXT },  /* rw */
+  { "pmslatfr_el1",     CPENC (3, 0, C9, C9, 6),  F_ARCHEXT },  /* rw */
+  { "pmsidr_el1",       CPENC (3, 0, C9, C9, 7),  F_ARCHEXT },  /* ro */
+  { "pmscr_el2",        CPENC (3, 4, C9, C9, 0),  F_ARCHEXT },  /* rw */
+  { "pmscr_el12",       CPENC (3, 5, C9, C9, 0),  F_ARCHEXT },  /* rw */
   { "pmcr_el0",          CPENC(3,3,C9,C12, 0), 0 },
   { "pmcntenset_el0",    CPENC(3,3,C9,C12, 1), 0 },
   { "pmcntenclr_el0",    CPENC(3,3,C9,C12, 2), 0 },
@@ -3215,6 +3227,23 @@ aarch64_sys_reg_supported_p (const aarch64_feature_set features,
       && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_RAS))
     return FALSE;
 
+  /* Statistical Profiling extension.  */
+  if ((reg->value == CPENC (3, 0, C9, C10, 0)
+       || reg->value == CPENC (3, 0, C9, C10, 1)
+       || reg->value == CPENC (3, 0, C9, C10, 3)
+       || reg->value == CPENC (3, 0, C9, C10, 7)
+       || reg->value == CPENC (3, 0, C9, C9, 0)
+       || reg->value == CPENC (3, 0, C9, C9, 2)
+       || reg->value == CPENC (3, 0, C9, C9, 3)
+       || reg->value == CPENC (3, 0, C9, C9, 4)
+       || reg->value == CPENC (3, 0, C9, C9, 5)
+       || reg->value == CPENC (3, 0, C9, C9, 6)
+       || reg->value == CPENC (3, 0, C9, C9, 7)
+       || reg->value == CPENC (3, 4, C9, C9, 0)
+       || reg->value == CPENC (3, 5, C9, C9, 0))
+      && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_PROFILE))
+    return FALSE;
+
   return TRUE;
 }