public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Matthieu Longo <matthieu.longo@arm.com>
To: <binutils@sourceware.org>
Cc: Richard Earnshaw <richard.earnshaw@arm.com>,
	Nick Clifton <nickc@redhat.com>,
	Matthieu Longo <matthieu.longo@arm.com>
Subject: [PATCH v1 2/4] aarch64: add SPMU2 feature and its associated registers
Date: Thu, 4 Jul 2024 15:23:36 +0100	[thread overview]
Message-ID: <20240704142338.1582659-3-matthieu.longo@arm.com> (raw)
In-Reply-To: <20240704142338.1582659-1-matthieu.longo@arm.com>

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]


AArch64 defines new registers for the feature spmu2 (System Performance
Monitors Extension version 2). spmu2 is an Armv9.5-A feature.

This patch also adds relevant tests. Regression tested on aarch64-none-elf,
and no regression found.
---
 .../aarch64/sysreg/armv9_5-a-sysregs-archv9_4-unsupported.l   | 4 ++++
 gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.d          | 2 ++
 gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.s          | 3 +++
 include/opcode/aarch64.h                                      | 3 +++
 opcodes/aarch64-sys-regs.def                                  | 1 +
 5 files changed, 13 insertions(+)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v1-0002-aarch64-add-SPMU2-feature-and-its-associated-regi.patch --]
[-- Type: text/x-patch; name="v1-0002-aarch64-add-SPMU2-feature-and-its-associated-regi.patch", Size: 3464 bytes --]

diff --git a/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs-archv9_4-unsupported.l b/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs-archv9_4-unsupported.l
index cf7f21febf7..66dd5e8558e 100644
--- a/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs-archv9_4-unsupported.l
+++ b/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs-archv9_4-unsupported.l
@@ -7,3 +7,7 @@
 [^ :]+:[0-9]+:  Info: macro invoked from here
 [^ :]+:[0-9]+: Error: selected processor does not support system register name 'vsesr_el3'
 [^ :]+:[0-9]+:  Info: macro invoked from here
+[^ :]+:[0-9]+: Error: selected processor does not support system register name 'spmzr_el0'
+[^ :]+:[0-9]+:  Info: macro invoked from here
+[^ :]+:[0-9]+: Error: selected processor does not support system register name 'spmzr_el0'
+[^ :]+:[0-9]+:  Info: macro invoked from here
\ No newline at end of file
diff --git a/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.d b/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.d
index 31f4eb8e9cb..1a6c3be8abb 100644
--- a/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.d
+++ b/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.d
@@ -11,3 +11,5 @@ Disassembly of section \.text:
 .*:	d53ec120 	mrs	x0, vdisr_el3
 .*:	d51e5260 	msr	vsesr_el3, x0
 .*:	d53e5260 	mrs	x0, vsesr_el3
+.*:	d5139c80 	msr	spmzr_el0, x0
+.*:	d5339c80 	mrs	x0, spmzr_el0
diff --git a/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.s b/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.s
index 085fced1652..701a80ce903 100644
--- a/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.s
+++ b/gas/testsuite/gas/aarch64/sysreg/armv9_5-a-sysregs.s
@@ -5,3 +5,6 @@
 /* Delegated SError exceptions for EL3. */
 rw_sys_reg sys_reg=vdisr_el3 xreg=x0 r=1 w=1
 rw_sys_reg sys_reg=vsesr_el3 xreg=x0 r=1 w=1
+
+/* System Performance Monitors Extension version 2. */
+rw_sys_reg sys_reg=spmzr_el0 xreg=x0 r=1 w=1
diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h
index 17c4ee95e73..4dc30193d40 100644
--- a/include/opcode/aarch64.h
+++ b/include/opcode/aarch64.h
@@ -222,6 +222,8 @@ enum aarch64_feature_bit {
   AARCH64_FEATURE_PMUv3_ICNTR,
   /* System Performance Monitors Extension */
   AARCH64_FEATURE_SPMU,
+  /* System Performance Monitors Extension version 2 */
+  AARCH64_FEATURE_SPMU2,
   /* Performance Monitors Synchronous-Exception-Based Event Extension.  */
   AARCH64_FEATURE_SEBEP,
   /* SVE2.1 and SME2.1 non-widening BFloat16 instructions.  */
@@ -370,6 +372,7 @@ enum aarch64_feature_bit {
 					 | AARCH64_FEATBIT (X, LUT)	\
 					 | AARCH64_FEATBIT (X, FAMINMAX)\
 					 | AARCH64_FEATBIT (X, E3DSE)	\
+					 | AARCH64_FEATBIT (X, SPMU2)	\
 					)
 
 /* Architectures are the sum of the base and extensions.  */
diff --git a/opcodes/aarch64-sys-regs.def b/opcodes/aarch64-sys-regs.def
index def3dd65633..4fbc65e32fd 100644
--- a/opcodes/aarch64-sys-regs.def
+++ b/opcodes/aarch64-sys-regs.def
@@ -951,6 +951,7 @@
   SYSREG ("spmrootcr_el3",	CPENC (2,6,9,14,7),	F_ARCHEXT,		AARCH64_FEATURE (SPMU))
   SYSREG ("spmscr_el1",		CPENC (2,7,9,14,7),	F_ARCHEXT,		AARCH64_FEATURE (SPMU))
   SYSREG ("spmselr_el0",	CPENC (2,3,9,12,5),	F_ARCHEXT,		AARCH64_FEATURE (SPMU))
+  SYSREG ("spmzr_el0",		CPENC (2,3,9,12,4),	F_ARCHEXT,		AARCH64_FEATURE (SPMU2))
   SYSREG ("spsel",		CPENC (3,0,4,2,0),	0,			AARCH64_NO_FEATURES)
   SYSREG ("spsr_abt",		CPENC (3,4,4,3,1),	0,			AARCH64_NO_FEATURES)
   SYSREG ("spsr_el1",		CPENC (3,0,4,0,0),	0,			AARCH64_NO_FEATURES)

  parent reply	other threads:[~2024-07-04 14:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-04 14:23 [PATCH v1 0/4] aarch64: add new Armv9.5-A features and their associated registers (RAS, Debug, Performance Monitor) Matthieu Longo
2024-07-04 14:23 ` [PATCH v1 1/4] aarch64: add E3DSE feature and its associated registers Matthieu Longo
2024-07-04 14:23 ` Matthieu Longo [this message]
2024-07-04 14:23 ` [PATCH v1 3/4] aarch64: add STEP2 " Matthieu Longo
2024-07-04 14:23 ` [PATCH v1 4/4] aarch64: add Debug Feature Register 2 (ID_AA64DFR2_EL1) Matthieu Longo
2024-07-05 12:20 ` [PATCH v1 0/4] aarch64: add new Armv9.5-A features and their associated registers (RAS, Debug, Performance Monitor) Richard Earnshaw (lists)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240704142338.1582659-3-matthieu.longo@arm.com \
    --to=matthieu.longo@arm.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=richard.earnshaw@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).