Skip to content

Commit 78b692d

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 2d7f310 commit 78b692d

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
@@ -1187,6 +1187,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
11871187
{"smepmp", "zicsr", check_implicit_always},
11881188
{"ssaia", "zicsr", check_implicit_always},
11891189
{"sscofpmf", "zicsr", check_implicit_always},
1190+
{"ssqosid", "zicsr", check_implicit_always},
11901191
{"ssstateen", "zicsr", check_implicit_always},
11911192
{"sstc", "zicsr", check_implicit_always},
11921193
{NULL, NULL, NULL}
@@ -1331,6 +1332,7 @@ static struct riscv_supported_ext riscv_supported_std_s_ext[] =
13311332
{"smstateen", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13321333
{"ssaia", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13331334
{"sscofpmf", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1335+
{"ssqosid", ISA_SPEC_CLASS_DRAFT, 0, 1, 0 },
13341336
{"ssstateen", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13351337
{"sstc", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13361338
{"svinval", 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
@@ -80,6 +80,7 @@ enum riscv_csr_class
8080
CSR_CLASS_SSAIA_AND_H, /* Ssaia with H */
8181
CSR_CLASS_SSAIA_32, /* Ssaia, rv32 only */
8282
CSR_CLASS_SSAIA_AND_H_32, /* Ssaia with H, rv32 only */
83+
CSR_CLASS_SSQOSID, /* Ssqosid */
8384
CSR_CLASS_SSSTATEEN, /* S[ms]stateen only */
8485
CSR_CLASS_SSSTATEEN_AND_H, /* S[ms]stateen only (with H) */
8586
CSR_CLASS_SSSTATEEN_AND_H_32, /* S[ms]stateen RV32 only (with H) */
@@ -1068,6 +1069,9 @@ riscv_csr_address (const char *csr_name,
10681069
|| csr_class == CSR_CLASS_SSAIA_AND_H_32);
10691070
extension = "ssaia";
10701071
break;
1072+
case CSR_CLASS_SSQOSID:
1073+
extension = "ssqosid";
1074+
break;
10711075
case CSR_CLASS_SSSTATEEN_AND_H_32:
10721076
is_rv32_only = true;
10731077
/* Fall through. */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ Contents of the .* section:
395395
DW_CFA_offset_extended_sf: r5949 \(mhpmevent29h\) at cfa\+7412
396396
DW_CFA_offset_extended_sf: r5950 \(mhpmevent30h\) at cfa\+7416
397397
DW_CFA_offset_extended_sf: r5951 \(mhpmevent31h\) at cfa\+7420
398+
DW_CFA_offset_extended_sf: r5568 \(sqoscfg\) at cfa\+5888
398399
DW_CFA_offset_extended_sf: r4429 \(stimecmp\) at cfa\+1332
399400
DW_CFA_offset_extended_sf: r4445 \(stimecmph\) at cfa\+1396
400401
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
@@ -395,6 +395,8 @@ _start:
395395
.cfi_offset mhpmevent29h, 7412
396396
.cfi_offset mhpmevent30h, 7416
397397
.cfi_offset mhpmevent31h, 7420
398+
# Ssqosid extension
399+
.cfi_offset sqoscfg, 5888
398400
# Sstc extension
399401
.cfi_offset stimecmp, 1332
400402
.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
@@ -765,6 +765,8 @@ Disassembly of section .text:
765765
[ ]+[0-9a-f]+:[ ]+73e59073[ ]+csrw[ ]+mhpmevent30h,a1
766766
[ ]+[0-9a-f]+:[ ]+73f02573[ ]+csrr[ ]+a0,mhpmevent31h
767767
[ ]+[0-9a-f]+:[ ]+73f59073[ ]+csrw[ ]+mhpmevent31h,a1
768+
[ ]+[0-9a-f]+:[ ]+5c002573[ ]+csrr[ ]+a0,sqoscfg
769+
[ ]+[0-9a-f]+:[ ]+5c059073[ ]+csrw[ ]+sqoscfg,a1
768770
[ ]+[0-9a-f]+:[ ]+14d02573[ ]+csrr[ ]+a0,stimecmp
769771
[ ]+[0-9a-f]+:[ ]+14d59073[ ]+csrw[ ]+stimecmp,a1
770772
[ ]+[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
@@ -1455,6 +1455,10 @@
14551455
.*Info: macro .*
14561456
.*Warning: invalid CSR `mhpmevent31h', needs `sscofpmf' extension
14571457
.*Info: macro .*
1458+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1459+
.*Info: macro .*
1460+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1461+
.*Info: macro .*
14581462
.*Warning: invalid CSR `stimecmp', needs `sstc' extension
14591463
.*Info: macro .*
14601464
.*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
@@ -765,6 +765,8 @@ Disassembly of section .text:
765765
[ ]+[0-9a-f]+:[ ]+73e59073[ ]+csrw[ ]+mhpmevent30h,a1
766766
[ ]+[0-9a-f]+:[ ]+73f02573[ ]+csrr[ ]+a0,mhpmevent31h
767767
[ ]+[0-9a-f]+:[ ]+73f59073[ ]+csrw[ ]+mhpmevent31h,a1
768+
[ ]+[0-9a-f]+:[ ]+5c002573[ ]+csrr[ ]+a0,sqoscfg
769+
[ ]+[0-9a-f]+:[ ]+5c059073[ ]+csrw[ ]+sqoscfg,a1
768770
[ ]+[0-9a-f]+:[ ]+14d02573[ ]+csrr[ ]+a0,stimecmp
769771
[ ]+[0-9a-f]+:[ ]+14d59073[ ]+csrw[ ]+stimecmp,a1
770772
[ ]+[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
@@ -1451,6 +1451,10 @@
14511451
.*Info: macro .*
14521452
.*Warning: invalid CSR `mhpmevent31h', needs `sscofpmf' extension
14531453
.*Info: macro .*
1454+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1455+
.*Info: macro .*
1456+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1457+
.*Info: macro .*
14541458
.*Warning: invalid CSR `stimecmp', needs `sstc' extension
14551459
.*Info: macro .*
14561460
.*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
@@ -765,6 +765,8 @@ Disassembly of section .text:
765765
[ ]+[0-9a-f]+:[ ]+73e59073[ ]+csrw[ ]+mhpmevent30h,a1
766766
[ ]+[0-9a-f]+:[ ]+73f02573[ ]+csrr[ ]+a0,mhpmevent31h
767767
[ ]+[0-9a-f]+:[ ]+73f59073[ ]+csrw[ ]+mhpmevent31h,a1
768+
[ ]+[0-9a-f]+:[ ]+5c002573[ ]+csrr[ ]+a0,sqoscfg
769+
[ ]+[0-9a-f]+:[ ]+5c059073[ ]+csrw[ ]+sqoscfg,a1
768770
[ ]+[0-9a-f]+:[ ]+14d02573[ ]+csrr[ ]+a0,stimecmp
769771
[ ]+[0-9a-f]+:[ ]+14d59073[ ]+csrw[ ]+stimecmp,a1
770772
[ ]+[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
@@ -1175,6 +1175,10 @@
11751175
.*Info: macro .*
11761176
.*Warning: invalid CSR `mhpmevent31h', needs `sscofpmf' extension
11771177
.*Info: macro .*
1178+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1179+
.*Info: macro .*
1180+
.*Warning: invalid CSR `sqoscfg', needs `ssqosid' extension
1181+
.*Info: macro .*
11781182
.*Warning: invalid CSR `stimecmp', needs `sstc' extension
11791183
.*Info: macro .*
11801184
.*Warning: invalid CSR `stimecmp', needs `sstc' extension

0 commit comments

Comments
 (0)