public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: Add support for the fpmr system register
@ 2024-04-26 15:00 Claudio Bantaloukas
  2024-04-30  9:33 ` Victor Do Nascimento
  0 siblings, 1 reply; 2+ messages in thread
From: Claudio Bantaloukas @ 2024-04-26 15:00 UTC (permalink / raw)
  To: claudio.bantaloukas, binutils, Victor.DoNascimento; +Cc: nd

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


AArch64 defines a read-write system register called fpmr.
This floating point mode register controls behaviours of the FP8 instructions.
This patch adds support for reading and writing along with relevant tests.
Regression tested on the aarch64-none-elf and aarch64-none-linux-gnu targets
and no regressions were found.

---

Hi,

Is this Ok for master? I do not have commit rights, if OK, can someone commit on my behalf please?

Thanks,
Claudio Bantaloukas

 .../gas/aarch64/sysreg/fp8-feature-enables-fpmr.d    | 12 ++++++++++++
 .../gas/aarch64/sysreg/fpmr-unsupported-by-default.d |  4 ++++
 .../gas/aarch64/sysreg/fpmr-unsupported-by-default.l |  3 +++
 gas/testsuite/gas/aarch64/sysreg/fpmr.s              |  4 ++++
 opcodes/aarch64-sys-regs.def                         |  1 +
 5 files changed, 24 insertions(+)
 create mode 100644 gas/testsuite/gas/aarch64/sysreg/fp8-feature-enables-fpmr.d
 create mode 100644 gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.d
 create mode 100644 gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.l
 create mode 100644 gas/testsuite/gas/aarch64/sysreg/fpmr.s


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-aarch64-Add-support-for-the-fpmr-system-register.patch --]
[-- Type: text/x-patch; name="0001-aarch64-Add-support-for-the-fpmr-system-register.patch", Size: 2435 bytes --]

diff --git a/gas/testsuite/gas/aarch64/sysreg/fp8-feature-enables-fpmr.d b/gas/testsuite/gas/aarch64/sysreg/fp8-feature-enables-fpmr.d
new file mode 100644
index 00000000000..edef376de87
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/sysreg/fp8-feature-enables-fpmr.d
@@ -0,0 +1,12 @@
+#name: Test that fpmr register is gated and available via the fp8 feature
+#source: fpmr.s
+#as: -march=armv9.2-a+fp8
+#objdump: -dr
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+0+ <.*>:
+   0:	d53b4440 	mrs	x0, fpmr
+   4:	d51b4440 	msr	fpmr, x0
diff --git a/gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.d b/gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.d
new file mode 100644
index 00000000000..c0b30c2e149
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.d
@@ -0,0 +1,4 @@
+#name: Test that fpmr register is not supported by default
+#source: fpmr.s
+#as: -march=armv9.2-a
+#error_output: fpmr-unsupported-by-default.l
diff --git a/gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.l b/gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.l
new file mode 100644
index 00000000000..43de01860c4
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.l
@@ -0,0 +1,3 @@
+[^:]*: Assembler messages:
+.*: Error: selected processor does not support system register name 'fpmr'
+.*: Error: selected processor does not support system register name 'fpmr'
diff --git a/gas/testsuite/gas/aarch64/sysreg/fpmr.s b/gas/testsuite/gas/aarch64/sysreg/fpmr.s
new file mode 100644
index 00000000000..302847daaba
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/sysreg/fpmr.s
@@ -0,0 +1,4 @@
+	.text
+
+  mrs x0, fpmr
+  msr fpmr, x0
diff --git a/opcodes/aarch64-sys-regs.def b/opcodes/aarch64-sys-regs.def
index 8b65673a5d6..fabcea1fc7d 100644
--- a/opcodes/aarch64-sys-regs.def
+++ b/opcodes/aarch64-sys-regs.def
@@ -423,6 +423,7 @@
   SYSREG ("far_el3",		CPENC (3,6,6,0,0),	0,			AARCH64_NO_FEATURES)
   SYSREG ("fpcr",		CPENC (3,3,4,4,0),	0,			AARCH64_NO_FEATURES)
   SYSREG ("fpexc32_el2",	CPENC (3,4,5,3,0),	0,			AARCH64_NO_FEATURES)
+  SYSREG ("fpmr",		CPENC (3,3,4,4,2),	F_ARCHEXT,		AARCH64_FEATURE (FP8))
   SYSREG ("fpsr",		CPENC (3,3,4,4,1),	0,			AARCH64_NO_FEATURES)
   SYSREG ("gcspr_el0",		CPENC (3,3,2,5,1),    	F_ARCHEXT,		AARCH64_FEATURE (GCS))
   SYSREG ("gcspr_el1",		CPENC (3,0,2,5,1),    	F_ARCHEXT,		AARCH64_FEATURE (GCS))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] aarch64: Add support for the fpmr system register
  2024-04-26 15:00 [PATCH] aarch64: Add support for the fpmr system register Claudio Bantaloukas
@ 2024-04-30  9:33 ` Victor Do Nascimento
  0 siblings, 0 replies; 2+ messages in thread
From: Victor Do Nascimento @ 2024-04-30  9:33 UTC (permalink / raw)
  To: Claudio Bantaloukas, binutils, Richard.Earnshaw

Hi Claudio,

Patch looks good.  Any CI failures at this stage are to be expected, 
given how this patch is dependent on the upstreaming of my own FP8 patches.

Hopefully, once we have the relevant approval for this patch, we can 
push all FP8-related changes at once.  The idea behind pushing 
everything together comes from the fact that any FP8 work makes little 
sense without the necessary fpmr system-register enablement - which 
you've added here.

Thanks for doing this!
V.

On 4/26/24 16:00, Claudio Bantaloukas wrote:
> 
> AArch64 defines a read-write system register called fpmr.
> This floating point mode register controls behaviours of the FP8 instructions.
> This patch adds support for reading and writing along with relevant tests.
> Regression tested on the aarch64-none-elf and aarch64-none-linux-gnu targets
> and no regressions were found.
> 
> ---
> 
> Hi,
> 
> Is this Ok for master? I do not have commit rights, if OK, can someone commit on my behalf please?
> 
> Thanks,
> Claudio Bantaloukas
> 
>   .../gas/aarch64/sysreg/fp8-feature-enables-r.d    | 12 ++++++++++++
>   .../gas/aarch64/sysreg/fpmr-unsupported-by-default.d |  4 ++++
>   .../gas/aarch64/sysreg/fpmr-unsupported-by-default.l |  3 +++
>   gas/testsuite/gas/aarch64/sysreg/fpmr.s              |  4 ++++
>   opcodes/aarch64-sys-regs.def                         |  1 +
>   5 files changed, 24 insertions(+)
>   create mode 100644 gas/testsuite/gas/aarch64/sysreg/fp8-feature-enables-fpmr.d
>   create mode 100644 gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.d
>   create mode 100644 gas/testsuite/gas/aarch64/sysreg/fpmr-unsupported-by-default.l
>   create mode 100644 gas/testsuite/gas/aarch64/sysreg/fpmr.s
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-30  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 15:00 [PATCH] aarch64: Add support for the fpmr system register Claudio Bantaloukas
2024-04-30  9:33 ` Victor Do Nascimento

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).