[PATCH v1] aarch64: Remove guarding restrictions on system registers by default.
Srinath Parvathaneni
srinath.parvathaneni@arm.com
Wed Jun 11 09:28:17 GMT 2025
The current implementation of system register in assembler are
guarded by following rules:
1. No restrictions.
2. Architecture version (eg: armv8.5-a)
3. Architecture features (eg:+sve)
4. Combination of both architecture version and architecture
feature (eg: armv9.5-a+profile).
5. Combination of multiple architecture features (eg: +memtag+pops).
In this patch we are removing all the above mentioned guarding
restrictions and making the system registers available by default
in the assembler.
Also we are adding a command line flag "-menable-sysreg-checking",
which enforces the current restrictions on system registers.
But there is one exception with the default behaviour, even though we
have removed all the restrictions on system registers, the 128 bit
system instructions like mrrs and msrr which uses the 128 bit system
registers as operands, are not available unless we pass
".arch_extension d128" directive or "+d128" flag to the assembler.
eg:
.arch_extension d128 // For the msrr and mrrs instructions.
msrr rcwmask_el1, x2, x3
mrrs x2, x3, rcwmask_el1
All the current system registers *.d files are added with
"-menable-sysreg-checking" flag to assembler, so that all those
system registers get testing with current guarding restrictions.
Also we have tested the assembler behaviour with this patch for
following scenarios:
1. sysregs with no guarding reatrictions.
2. sysregs with no guarding restrictions + "-menable-sysreg-checking".
3. sysregs with guarding restrictions + "-menable-sysreg-checking".
Regression tested for aarch64-none-elf target and found no regressions.
Ok for binutils-master?
Regards,
Srinath.
Co-authored-by: Andre Simoes Dias Vieira <andre.simoesdiasvieira@arm.com>
---
gas/config/tc-aarch64.c | 3 +
gas/testsuite/gas/aarch64/armv8-ras-1.d | 2 +-
.../gas/aarch64/armv8_4-a-registers-illegal.d | 2 +-
.../gas/aarch64/armv8_4-a-registers.d | 2 +-
gas/testsuite/gas/aarch64/gpc3.d | 2 +-
gas/testsuite/gas/aarch64/illegal-ite1-1.d | 4 +-
.../gas/aarch64/illegal-predres2-1.d | 4 +-
gas/testsuite/gas/aarch64/illegal.d | 2 +-
gas/testsuite/gas/aarch64/ite1.d | 2 +-
gas/testsuite/gas/aarch64/mec-arch-bad.d | 2 +-
gas/testsuite/gas/aarch64/mec.d | 2 +-
gas/testsuite/gas/aarch64/msr.d | 2 +-
gas/testsuite/gas/aarch64/pan-directive.d | 2 +-
gas/testsuite/gas/aarch64/pan.d | 2 +-
gas/testsuite/gas/aarch64/sme-8.d | 2 +-
gas/testsuite/gas/aarch64/ssbs-illegal2.d | 2 +-
gas/testsuite/gas/aarch64/ssbs1.d | 2 +-
gas/testsuite/gas/aarch64/ssbs2.d | 2 +-
.../gas/aarch64/sysreg/armv8_8-a-sysregs.d | 2 +-
.../aarch64/sysreg/armv8_9-a-sysregs-bad.d | 2 +-
.../gas/aarch64/sysreg/armv8_9-a-sysregs.d | 2 +-
.../armv9_5-a-sysregs-archv9_4-unsupported.d | 2 +-
.../gas/aarch64/sysreg/armv9_5-a-sysregs.d | 2 +-
.../aarch64/sysreg/fp8-feature-enables-fpmr.d | 2 +-
.../sysreg/fpmr-unsupported-by-default.d | 2 +-
.../gas/aarch64/sysreg/gcs-sysregs-bad.d | 2 +-
.../gas/aarch64/sysreg/gcs-sysregs.d | 2 +-
.../gas/aarch64/sysreg/illegal-sysreg-3.d | 2 +-
.../gas/aarch64/sysreg/illegal-sysreg-4.d | 2 +-
.../gas/aarch64/sysreg/illegal-sysreg-4b.d | 2 +-
.../gas/aarch64/sysreg/illegal-sysreg-5.d | 2 +-
.../gas/aarch64/sysreg/illegal-sysreg-7.d | 1 +
.../gas/aarch64/sysreg/illegal-sysreg-8.d | 2 +-
.../gas/aarch64/sysreg/illegal-sysreg-8b.d | 2 +-
.../gas/aarch64/sysreg/pops-sysregs-bad.d | 2 +-
.../gas/aarch64/sysreg/pops-sysregs.d | 2 +-
.../gas/aarch64/sysreg/sme-sysreg-illegal.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sme-sysreg.d | 2 +-
.../gas/aarch64/sysreg/sve-sysreg-invalid.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sve-sysreg.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-1.d | 2 +-
.../gas/aarch64/sysreg/sysreg-10-bad.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-10.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-2.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-3.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-4.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-6.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-7.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-8.d | 2 +-
.../gas/aarch64/sysreg/sysreg-9-bad.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg-9.d | 2 +-
.../gas/aarch64/sysreg/sysreg-diagnostic.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg.d | 2 +-
gas/testsuite/gas/aarch64/sysreg/sysreg128.d | 2 +-
.../sysreg/sysregs_with_no_restrictions-bad.d | 3 +
.../sysreg/sysregs_with_no_restrictions-bad.l | 173 ++++++++++++++++++
.../sysreg/sysregs_with_no_restrictions.d | 95 ++++++++++
.../sysreg/sysregs_with_no_restrictions.s | 56 ++++++
.../sysreg/sysregs_with_restrictions.d | 95 ++++++++++
.../sysreg/sysregs_with_restrictions.s | 93 ++++++++++
.../gas/aarch64/sysreg/v8-r-bad-sysregs.d | 1 +
.../aarch64/sysreg/v8-r-sysregs-need-arch.d | 1 +
.../gas/aarch64/sysreg/v8-r-sysregs.d | 2 +-
gas/testsuite/gas/aarch64/uao-directive.d | 2 +-
gas/testsuite/gas/aarch64/uao.d | 2 +-
.../gas/aarch64/virthostext-directive.d | 2 +-
gas/testsuite/gas/aarch64/virthostext.d | 2 +-
include/opcode/aarch64.h | 1 +
opcodes/aarch64-opc.c | 7 +-
69 files changed, 587 insertions(+), 60 deletions(-)
create mode 100644 gas/testsuite/gas/aarch64/sysreg/sysregs_with_no_restrictions-bad.d
create mode 100644 gas/testsuite/gas/aarch64/sysreg/sysregs_with_no_restrictions-bad.l
create mode 100644 gas/testsuite/gas/aarch64/sysreg/sysregs_with_no_restrictions.d
create mode 100644 gas/testsuite/gas/aarch64/sysreg/sysregs_with_no_restrictions.s
create mode 100644 gas/testsuite/gas/aarch64/sysreg/sysregs_with_restrictions.d
create mode 100644 gas/testsuite/gas/aarch64/sysreg/sysregs_with_restrictions.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-aarch64-Remove-guarding-restrictions-on-system-re.patch
Type: text/x-patch
Size: 50278 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250611/6e5cd485/attachment-0001.bin>
More information about the Binutils
mailing list