Skip to content

Commit 7b2a5f7

Browse files
jerryzjNelson Chu
authored and
Nelson Chu
committed
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 <[email protected]>
1 parent 614d1b7 commit 7b2a5f7

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

bfd/elfxx-riscv.c

+35
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,11 @@ static struct riscv_supported_ext riscv_supported_std_s_ext[] =
14771477
{"svnapot", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
14781478
{"svpbmt", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
14791479
{"ssqosid", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1480+
{"ssnpm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1481+
{"smnpm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1482+
{"smmpm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1483+
{"sspm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1484+
{"supm", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
14801485
{NULL, 0, 0, 0, 0}
14811486
};
14821487

@@ -2125,6 +2130,36 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps)
21252130
(_("`xtheadvector' is conflict with the `v' extension"));
21262131
no_conflict = false;
21272132
}
2133+
if (riscv_lookup_subset (rps->subset_list, "ssnpm", &subset) && xlen != 64)
2134+
{
2135+
rps->error_handler (_ ("rv%d does not support the `ssnpm' extension"),
2136+
xlen);
2137+
no_conflict = false;
2138+
}
2139+
if (riscv_lookup_subset (rps->subset_list, "smnpm", &subset) && xlen != 64)
2140+
{
2141+
rps->error_handler (_ ("rv%d does not support the `smnpm' extension"),
2142+
xlen);
2143+
no_conflict = false;
2144+
}
2145+
if (riscv_lookup_subset (rps->subset_list, "smmpm", &subset) && xlen != 64)
2146+
{
2147+
rps->error_handler (_ ("rv%d does not support the `smmpm' extension"),
2148+
xlen);
2149+
no_conflict = false;
2150+
}
2151+
if (riscv_lookup_subset (rps->subset_list, "sspm", &subset) && xlen != 64)
2152+
{
2153+
rps->error_handler (_ ("rv%d does not support the `sspm' extension"),
2154+
xlen);
2155+
no_conflict = false;
2156+
}
2157+
if (riscv_lookup_subset (rps->subset_list, "supm", &subset) && xlen != 64)
2158+
{
2159+
rps->error_handler (_ ("rv%d does not support the `supm' extension"),
2160+
xlen);
2161+
no_conflict = false;
2162+
}
21282163

21292164
bool support_zve = false;
21302165
bool support_zvl = false;

gas/NEWS

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
directives, the file need to be rebuilt since 2.45.
77

88
* Add support for RISC-V standard extensions:
9-
ssqosid v1.0.
9+
ssqosid v1.0, ssnpm v1.0, smnpm v1.0, smmpm v1.0, sspm v1.0, supm v1.0.
1010

1111
* Add support for RISC-V vendor extensions:
1212
T-Head: xtheadvdot v1.0.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#as: -march=rv32i_ssnpm_smnpm_smmpm_sspm_supm
2+
#source: empty.s
3+
#error_output: march-fail-rv32-pointer-masking.l
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.*Assembler messages:
2+
.*Error: rv32 does not support the `ssnpm' extension
3+
.*Error: rv32 does not support the `smnpm' extension
4+
.*Error: rv32 does not support the `smmpm' extension
5+
.*Error: rv32 does not support the `sspm' extension
6+
.*Error: rv32 does not support the `supm' extension

gas/testsuite/gas/riscv/march-help.l

+5
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ All available -march extensions for RISC-V:
140140
svnapot 1.0
141141
svpbmt 1.0
142142
ssqosid 1.0
143+
ssnpm 1.0
144+
smnpm 1.0
145+
smmpm 1.0
146+
sspm 1.0
147+
supm 1.0
143148
xcvalu 1.0
144149
xcvbi 1.0
145150
xcvbitmanip 1.0

0 commit comments

Comments
 (0)