aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Zhang Jian <jerry.zhangjian@sifive.com>2025-03-17 20:16:35 +0800
committerNelson Chu <nelson@rivosinc.com>2025-03-18 14:29:22 +0800
commit7b2a5f7183b946a0a2644a505892b7e0aefbbfd1 (patch)
tree734cbf9bf5c8b695560cc34d61f6dbd21713c788
parent614d1b72cea2b4d1d86fedc7cf608a3f167157fc (diff)
downloadbinutils-7b2a5f7183b946a0a2644a505892b7e0aefbbfd1.zip
binutils-7b2a5f7183b946a0a2644a505892b7e0aefbbfd1.tar.gz
binutils-7b2a5f7183b946a0a2644a505892b7e0aefbbfd1.tar.bz2
RISC-V: Support pointer masking extension 1.0
- Adding Ssnpm, Smnpm, Smmpm, Sspm, and Supm - No new CSR added - Pointer masking only applies to RV64 - Ref: https://github.com/riscv/riscv-j-extension/releases/download/pointer-masking-ratified/pointer-masking-ratified.pdf Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
-rw-r--r--bfd/elfxx-riscv.c35
-rw-r--r--gas/NEWS2
-rw-r--r--gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.d3
-rw-r--r--gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.l6
-rw-r--r--gas/testsuite/gas/riscv/march-help.l5
5 files changed, 50 insertions, 1 deletions
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index a2f67bc..481bac9 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1477,6 +1477,11 @@ static struct riscv_supported_ext riscv_supported_std_s_ext[] =
{"svnapot", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"svpbmt", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"ssqosid", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
+ {"ssnpm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
+ {"smnpm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
+ {"smmpm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
+ {"sspm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
+ {"supm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{NULL, 0, 0, 0, 0}
};
@@ -2125,6 +2130,36 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps)
(_("`xtheadvector' is conflict with the `v' extension"));
no_conflict = false;
}
+ if (riscv_lookup_subset (rps->subset_list, "ssnpm", &subset) && xlen != 64)
+ {
+ rps->error_handler (_ ("rv%d does not support the `ssnpm' extension"),
+ xlen);
+ no_conflict = false;
+ }
+ if (riscv_lookup_subset (rps->subset_list, "smnpm", &subset) && xlen != 64)
+ {
+ rps->error_handler (_ ("rv%d does not support the `smnpm' extension"),
+ xlen);
+ no_conflict = false;
+ }
+ if (riscv_lookup_subset (rps->subset_list, "smmpm", &subset) && xlen != 64)
+ {
+ rps->error_handler (_ ("rv%d does not support the `smmpm' extension"),
+ xlen);
+ no_conflict = false;
+ }
+ if (riscv_lookup_subset (rps->subset_list, "sspm", &subset) && xlen != 64)
+ {
+ rps->error_handler (_ ("rv%d does not support the `sspm' extension"),
+ xlen);
+ no_conflict = false;
+ }
+ if (riscv_lookup_subset (rps->subset_list, "supm", &subset) && xlen != 64)
+ {
+ rps->error_handler (_ ("rv%d does not support the `supm' extension"),
+ xlen);
+ no_conflict = false;
+ }
bool support_zve = false;
bool support_zvl = false;
diff --git a/gas/NEWS b/gas/NEWS
index dc09ef5..dc0fd10 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -6,7 +6,7 @@
directives, the file need to be rebuilt since 2.45.
* Add support for RISC-V standard extensions:
- ssqosid v1.0.
+ ssqosid v1.0, ssnpm v1.0, smnpm v1.0, smmpm v1.0, sspm v1.0, supm v1.0.
* Add support for RISC-V vendor extensions:
T-Head: xtheadvdot v1.0.
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.d b/gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.d
new file mode 100644
index 0000000..fb4dfc6
--- /dev/null
+++ b/gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.d
@@ -0,0 +1,3 @@
+#as: -march=rv32i_ssnpm_smnpm_smmpm_sspm_supm
+#source: empty.s
+#error_output: march-fail-rv32-pointer-masking.l
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.l b/gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.l
new file mode 100644
index 0000000..1196528
--- /dev/null
+++ b/gas/testsuite/gas/riscv/march-fail-rv32-pointer-masking.l
@@ -0,0 +1,6 @@
+.*Assembler messages:
+.*Error: rv32 does not support the `ssnpm' extension
+.*Error: rv32 does not support the `smnpm' extension
+.*Error: rv32 does not support the `smmpm' extension
+.*Error: rv32 does not support the `sspm' extension
+.*Error: rv32 does not support the `supm' extension
diff --git a/gas/testsuite/gas/riscv/march-help.l b/gas/testsuite/gas/riscv/march-help.l
index f4b1e30..d77472f 100644
--- a/gas/testsuite/gas/riscv/march-help.l
+++ b/gas/testsuite/gas/riscv/march-help.l
@@ -140,6 +140,11 @@ All available -march extensions for RISC-V:
svnapot 1.0
svpbmt 1.0
ssqosid 1.0
+ ssnpm 1.0
+ smnpm 1.0
+ smmpm 1.0
+ sspm 1.0
+ supm 1.0
xcvalu 1.0
xcvbi 1.0
xcvbitmanip 1.0