Skip to content

Commit 9d7e134

Browse files
committed
UNRATIFIED RISC-V: Add 'Ssqosid' extension and its TENTATIVE CSRs
[DO NOT MERGE] Until the 'Ssqosid' extension is frozen/ratified and the final version number is determined, this patch should not be merged upstream. This commit uses version 0.1 as the placeholder, not version 0.0.0 in the latest PDF documentation (since 0.0 is invalid). This commit adds QoS registration interface for S-mode ('Ssqosid' extension) support based on the specification: <riscv-non-isa/riscv-cbqri@3e06bc5> ***Draft Note*** Because CSR addresse is not fixed yet, this commit uses tentative addresse (a part of custom CSR space). bfd/ChangeLog: * elfxx-riscv.c (riscv_implicit_subsets) Add implications to 'Zicsr'. (riscv_supported_std_s_ext): Add 'Ssqosid' extension to valid 'S' extension list. gas/ChangeLog: * config/tc-riscv.c (enum riscv_csr_class): Add CSR class for the 'Ssqosid' extension. (riscv_csr_address): Add handling for new CSR class. * testsuite/gas/riscv/csr-dw-regnums.d: Add new CSR. * testsuite/gas/riscv/csr-dw-regnums.s: Likewise. * testsuite/gas/riscv/csr.s: Add new CSR. * testsuite/gas/riscv/csr-version-1p9p1.d: Likewise. * testsuite/gas/riscv/csr-version-1p9p1.l: Likewise. * testsuite/gas/riscv/csr-version-1p10.d: Likewise. * testsuite/gas/riscv/csr-version-1p10.l: Likewise. * testsuite/gas/riscv/csr-version-1p11.d: Likewise. * testsuite/gas/riscv/csr-version-1p11.l: Likewise. * testsuite/gas/riscv/csr-version-1p12.d: Likewise. * testsuite/gas/riscv/csr-version-1p12.l: Likewise. include/ChangeLog: * opcode/riscv-opc.h (CSR_SQOSCFG): New.
1 parent 6de11ff commit 9d7e134

File tree

14 files changed

+40
-0
lines changed

14 files changed

+40
-0
lines changed

bfd/elfxx-riscv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
11881188
{"smepmp", "zicsr", check_implicit_always},
11891189
{"ssaia", "zicsr", check_implicit_always},
11901190
{"sscofpmf", "zicsr", check_implicit_always},
1191+
{"ssqosid", "zicsr", check_implicit_always},
11911192
{"ssstateen", "zicsr", check_implicit_always},
11921193
{"sstc", "zicsr", check_implicit_always},
11931194
{"svadu", "zicsr", check_implicit_always},
@@ -1335,6 +1336,7 @@ static struct riscv_supported_ext riscv_supported_std_s_ext[] =
13351336
{"smstateen", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13361337
{"ssaia", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13371338
{"sscofpmf", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1339+
{"ssqosid", ISA_SPEC_CLASS_DRAFT, 0, 1, 0 },
13381340
{"ssstateen", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13391341
{"sstc", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13401342
{"svadu", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },

gas/config/tc-riscv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ enum riscv_csr_class
8282
CSR_CLASS_SSAIA_AND_H, /* Ssaia with H */
8383
CSR_CLASS_SSAIA_32, /* Ssaia, rv32 only */
8484
CSR_CLASS_SSAIA_AND_H_32, /* Ssaia with H, rv32 only */
85+
CSR_CLASS_SSQOSID, /* Ssqosid */
8586
CSR_CLASS_SSSTATEEN, /* S[ms]stateen only */
8687
CSR_CLASS_SSSTATEEN_AND_H, /* S[ms]stateen only (with H) */
8788
CSR_CLASS_SSSTATEEN_AND_H_32, /* S[ms]stateen RV32 only (with H) */
@@ -1077,6 +1078,9 @@ riscv_csr_address (const char *csr_name,
10771078
|| csr_class == CSR_CLASS_SSAIA_AND_H_32);
10781079
extension = "ssaia";
10791080
break;
1081+
case CSR_CLASS_SSQOSID:
1082+
extension = "ssqosid";
1083+
break;
10801084
case CSR_CLASS_SSSTATEEN_AND_H_32:
10811085
is_rv32_only = true;
10821086
/* Fall through. */

gas/testsuite/gas/riscv/csr-dw-regnums.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ Contents of the .* section:
399399
DW_CFA_offset_extended_sf: r5949 \(mhpmevent29h\) at cfa\+7412
400400
DW_CFA_offset_extended_sf: r5950 \(mhpmevent30h\) at cfa\+7416
401401
DW_CFA_offset_extended_sf: r5951 \(mhpmevent31h\) at cfa\+7420
402+
DW_CFA_offset_extended_sf: r5568 \(sqoscfg\) at cfa\+5888
402403
DW_CFA_offset_extended_sf: r4429 \(stimecmp\) at cfa\+1332
403404
DW_CFA_offset_extended_sf: r4445 \(stimecmph\) at cfa\+1396
404405
DW_CFA_offset_extended_sf: r4685 \(vstimecmp\) at cfa\+2356

gas/testsuite/gas/riscv/csr-dw-regnums.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ _start:
400400
.cfi_offset mhpmevent29h, 7412
401401
.cfi_offset mhpmevent30h, 7416
402402
.cfi_offset mhpmevent31h, 7420
403+
# Ssqosid extension
404+
.cfi_offset sqoscfg, 5888
403405
# Sstc extension
404406
.cfi_offset stimecmp, 1332
405407
.cfi_offset stimecmph, 1396

gas/testsuite/gas/riscv/csr-version-1p10.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ Disassembly of section .text:
773773
[ ]+[0-9a-f]+:[ ]+73e59073[ ]+csrw[ ]+mhpmevent30h,a1
774774
[ ]+[0-9a-f]+:[ ]+73f02573[ ]+csrr[ ]+a0,mhpmevent31h
775775
[ ]+[0-9a-f]+:[ ]+73f59073[ ]+csrw[ ]+mhpmevent31h,a1
776+
[ ]+[0-9a-f]+:[ ]+5c002573[ ]+csrr[ ]+a0,sqoscfg
777+
[ ]+[0-9a-f]+:[ ]+5c059073[ ]+csrw[ ]+sqoscfg,a1
776778
[ ]+[0-9a-f]+:[ ]+14d02573[ ]+csrr[ ]+a0,stimecmp
777779
[ ]+[0-9a-f]+:[ ]+14d59073[ ]+csrw[ ]+stimecmp,a1
778780
[ ]+[0-9a-f]+:[ ]+15d02573[ ]+csrr[ ]+a0,stimecmph

gas/testsuite/gas/riscv/csr-version-1p10.l

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,10 @@
14791479
.*Info: macro .*
14801480
.*Warning: invalid CSR `mhpmevent31h', needs `sscofpmf' extension
14811481
.*Info: macro .*
1482+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1483+
.*Info: macro .*
1484+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1485+
.*Info: macro .*
14821486
.*Warning: invalid CSR `stimecmp', needs `sstc' extension
14831487
.*Info: macro .*
14841488
.*Warning: invalid CSR `stimecmp', needs `sstc' extension

gas/testsuite/gas/riscv/csr-version-1p11.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ Disassembly of section .text:
773773
[ ]+[0-9a-f]+:[ ]+73e59073[ ]+csrw[ ]+mhpmevent30h,a1
774774
[ ]+[0-9a-f]+:[ ]+73f02573[ ]+csrr[ ]+a0,mhpmevent31h
775775
[ ]+[0-9a-f]+:[ ]+73f59073[ ]+csrw[ ]+mhpmevent31h,a1
776+
[ ]+[0-9a-f]+:[ ]+5c002573[ ]+csrr[ ]+a0,sqoscfg
777+
[ ]+[0-9a-f]+:[ ]+5c059073[ ]+csrw[ ]+sqoscfg,a1
776778
[ ]+[0-9a-f]+:[ ]+14d02573[ ]+csrr[ ]+a0,stimecmp
777779
[ ]+[0-9a-f]+:[ ]+14d59073[ ]+csrw[ ]+stimecmp,a1
778780
[ ]+[0-9a-f]+:[ ]+15d02573[ ]+csrr[ ]+a0,stimecmph

gas/testsuite/gas/riscv/csr-version-1p11.l

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,10 @@
14751475
.*Info: macro .*
14761476
.*Warning: invalid CSR `mhpmevent31h', needs `sscofpmf' extension
14771477
.*Info: macro .*
1478+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1479+
.*Info: macro .*
1480+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1481+
.*Info: macro .*
14781482
.*Warning: invalid CSR `stimecmp', needs `sstc' extension
14791483
.*Info: macro .*
14801484
.*Warning: invalid CSR `stimecmp', needs `sstc' extension

gas/testsuite/gas/riscv/csr-version-1p12.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ Disassembly of section .text:
773773
[ ]+[0-9a-f]+:[ ]+73e59073[ ]+csrw[ ]+mhpmevent30h,a1
774774
[ ]+[0-9a-f]+:[ ]+73f02573[ ]+csrr[ ]+a0,mhpmevent31h
775775
[ ]+[0-9a-f]+:[ ]+73f59073[ ]+csrw[ ]+mhpmevent31h,a1
776+
[ ]+[0-9a-f]+:[ ]+5c002573[ ]+csrr[ ]+a0,sqoscfg
777+
[ ]+[0-9a-f]+:[ ]+5c059073[ ]+csrw[ ]+sqoscfg,a1
776778
[ ]+[0-9a-f]+:[ ]+14d02573[ ]+csrr[ ]+a0,stimecmp
777779
[ ]+[0-9a-f]+:[ ]+14d59073[ ]+csrw[ ]+stimecmp,a1
778780
[ ]+[0-9a-f]+:[ ]+15d02573[ ]+csrr[ ]+a0,stimecmph

gas/testsuite/gas/riscv/csr-version-1p12.l

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,10 @@
11991199
.*Info: macro .*
12001200
.*Warning: invalid CSR `mhpmevent31h', needs `sscofpmf' extension
12011201
.*Info: macro .*
1202+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1203+
.*Info: macro .*
1204+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1205+
.*Info: macro .*
12021206
.*Warning: invalid CSR `stimecmp', needs `sstc' extension
12031207
.*Info: macro .*
12041208
.*Warning: invalid CSR `stimecmp', needs `sstc' extension

0 commit comments

Comments
 (0)