Skip to content

Commit a303646

Browse files
committed
RISC-V: Add 'Smcntrpmf' extension and its CSRs
This commit adds now stable and approved 'Smcntrpmf' extension defined by the RISC-V Cycle and Instret Privilege Mode Filtering specification. Note that, because mcyclecfg and minstretcfg CSRs conflict with the privileged specification version 1.9.1, CSRs for this extension are only enabled on the privileged specification version 1.10 or later. By checking the base privileged specification, we no longer need to change the design of base CSR handling. This is based on the specification version v1.0_rc1 (Frozen): <riscvarchive/riscv-smcntrpmf@32b752c> bfd/ChangeLog: * elfxx-riscv.c (riscv_implicit_subsets): Add implication rule from the new 'Smcntrpmf' extension. (riscv_supported_std_s_ext): Add 'Smcntrpmf' to the supported S extension list. gas/ChangeLog: * config/tc-riscv.c (enum riscv_csr_class): Add new CSR classes CSR_CLASS_SMCNTRPMF and CSR_CLASS_SMCNTRPMF_32. (riscv_csr_address): Add handling for new CSR classes. * testsuite/gas/riscv/csr-dw-regnums.s: Add new CSRs. Move "mscounteren" and "mhcounteren" CSRs and note that they are now aliases. * testsuite/gas/riscv/csr-dw-regnums.d: Reflect the change. * testsuite/gas/riscv/csr.s: Add new CSRs. Move "mscounteren" and "mhcounteren" CSRs and note that they are now reused for the 'Smcntrpmf' extension. * testsuite/gas/riscv/csr-version-1p9p1.d: Reflect the changes of csr.s. * 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: Add new CSRs noting that this extension is incompatible with the privileged specification version 1.9.1. Move "mscounteren" and "mhcounteren" CSRs, make them aliases and reuse the CSR numbers from the 'Smcntrpmf' extension. (CSR_MSCOUNTEREN, CSR_MHCOUNTEREN) Remove as "mscounteren" and "mhcounteren" are now aliases and new CSR macros are used instead. (CSR_MCYCLECFG, CSR_MINSTRETCFG, CSR_MCYCLECFGH, CSR_MINSTRETCFGH): New CSR macros.
1 parent 9294a13 commit a303646

File tree

14 files changed

+228
-50
lines changed

14 files changed

+228
-50
lines changed

bfd/elfxx-riscv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
11831183
{"zcd", "zca", check_implicit_always},
11841184
{"zcb", "zca", check_implicit_always},
11851185
{"smaia", "ssaia", check_implicit_always},
1186+
{"smcntrpmf", "zicsr", check_implicit_always},
11861187
{"smstateen", "ssstateen", check_implicit_always},
11871188
{"smepmp", "zicsr", check_implicit_always},
11881189
{"ssaia", "zicsr", check_implicit_always},
@@ -1328,6 +1329,7 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
13281329
static struct riscv_supported_ext riscv_supported_std_s_ext[] =
13291330
{
13301331
{"smaia", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
1332+
{"smcntrpmf", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13311333
{"smepmp", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13321334
{"smstateen", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
13331335
{"ssaia", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },

gas/config/tc-riscv.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ enum riscv_csr_class
7474
CSR_CLASS_H_32, /* hypervisor, rv32 only */
7575
CSR_CLASS_SMAIA, /* Smaia */
7676
CSR_CLASS_SMAIA_32, /* Smaia, rv32 only */
77+
CSR_CLASS_SMCNTRPMF, /* Smcntrpmf */
78+
CSR_CLASS_SMCNTRPMF_32, /* Smcntrpmf, rv32 only */
7779
CSR_CLASS_SMSTATEEN, /* Smstateen only */
7880
CSR_CLASS_SMSTATEEN_32, /* Smstateen RV32 only */
7981
CSR_CLASS_SSAIA, /* Ssaia */
@@ -1052,6 +1054,13 @@ riscv_csr_address (const char *csr_name,
10521054
case CSR_CLASS_SMAIA:
10531055
extension = "smaia";
10541056
break;
1057+
case CSR_CLASS_SMCNTRPMF_32:
1058+
is_rv32_only = true;
1059+
/* Fall through. */
1060+
case CSR_CLASS_SMCNTRPMF:
1061+
need_check_version = true;
1062+
extension = "smcntrpmf";
1063+
break;
10551064
case CSR_CLASS_SMSTATEEN_32:
10561065
is_rv32_only = true;
10571066
/* Fall through. */

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ Contents of the .* section:
324324
DW_CFA_offset_extended_sf: r4888 \(mvienh\) at cfa\+3168
325325
DW_CFA_offset_extended_sf: r4889 \(mviph\) at cfa\+3172
326326
DW_CFA_offset_extended_sf: r4948 \(miph\) at cfa\+3408
327+
DW_CFA_offset_extended_sf: r4897 \(mcyclecfg\) at cfa\+3204
328+
DW_CFA_offset_extended_sf: r4898 \(minstretcfg\) at cfa\+3208
329+
DW_CFA_offset_extended_sf: r5921 \(mcyclecfgh\) at cfa\+7300
330+
DW_CFA_offset_extended_sf: r5922 \(minstretcfgh\) at cfa\+7304
327331
DW_CFA_offset_extended_sf: r4876 \(mstateen0\) at cfa\+3120
328332
DW_CFA_offset_extended_sf: r4877 \(mstateen1\) at cfa\+3124
329333
DW_CFA_offset_extended_sf: r4878 \(mstateen2\) at cfa\+3128
@@ -404,14 +408,14 @@ Contents of the .* section:
404408
DW_CFA_offset_extended_sf: r4480 \(satp\) at cfa\+1536
405409
DW_CFA_offset_extended_sf: r4931 \(mtval\) at cfa\+3340
406410
DW_CFA_offset_extended_sf: r4896 \(mcountinhibit\) at cfa\+3200
411+
DW_CFA_offset_extended_sf: r4897 \(mcyclecfg\) at cfa\+3204
412+
DW_CFA_offset_extended_sf: r4898 \(minstretcfg\) at cfa\+3208
407413
DW_CFA_offset_extended_sf: r4992 \(mbase\) at cfa\+3584
408414
DW_CFA_offset_extended_sf: r4993 \(mbound\) at cfa\+3588
409415
DW_CFA_offset_extended_sf: r4994 \(mibase\) at cfa\+3592
410416
DW_CFA_offset_extended_sf: r4995 \(mibound\) at cfa\+3596
411417
DW_CFA_offset_extended_sf: r4996 \(mdbase\) at cfa\+3600
412418
DW_CFA_offset_extended_sf: r4997 \(mdbound\) at cfa\+3604
413-
DW_CFA_offset_extended_sf: r4897 \(mscounteren\) at cfa\+3204
414-
DW_CFA_offset_extended_sf: r4898 \(mhcounteren\) at cfa\+3208
415419
DW_CFA_offset_extended: r4096 \(ustatus\) at cfa\+0
416420
DW_CFA_offset_extended_sf: r4100 \(uie\) at cfa\+16
417421
DW_CFA_offset_extended_sf: r4101 \(utvec\) at cfa\+20

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ _start:
321321
.cfi_offset mvienh, 3168
322322
.cfi_offset mviph, 3172
323323
.cfi_offset miph, 3408
324+
# Smcntrpmf extension
325+
.cfi_offset mcyclecfg, 3204
326+
.cfi_offset minstretcfg, 3208
327+
.cfi_offset mcyclecfgh, 7300
328+
.cfi_offset minstretcfgh, 7304
324329
# Smstateen extension
325330
.cfi_offset mstateen0, 3120
326331
.cfi_offset mstateen1, 3124
@@ -406,14 +411,14 @@ _start:
406411
.cfi_offset sptbr, 1536 # aliases
407412
.cfi_offset mbadaddr, 3340 # aliases
408413
.cfi_offset mucounteren, 3200 # aliases
414+
.cfi_offset mscounteren, 3204 # aliases
415+
.cfi_offset mhcounteren, 3208 # aliases
409416
.cfi_offset mbase, 3584
410417
.cfi_offset mbound, 3588
411418
.cfi_offset mibase, 3592
412419
.cfi_offset mibound, 3596
413420
.cfi_offset mdbase, 3600
414421
.cfi_offset mdbound, 3604
415-
.cfi_offset mscounteren, 3204
416-
.cfi_offset mhcounteren, 3208
417422
.cfi_offset ustatus, 0
418423
.cfi_offset uie, 16
419424
.cfi_offset utvec, 20

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,14 @@ Disassembly of section .text:
623623
[ ]+[0-9a-f]+:[ ]+31959073[ ]+csrw[ ]+mviph,a1
624624
[ ]+[0-9a-f]+:[ ]+35402573[ ]+csrr[ ]+a0,miph
625625
[ ]+[0-9a-f]+:[ ]+35459073[ ]+csrw[ ]+miph,a1
626+
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,mcyclecfg
627+
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+mcyclecfg,a1
628+
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,minstretcfg
629+
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+minstretcfg,a1
630+
[ ]+[0-9a-f]+:[ ]+72102573[ ]+csrr[ ]+a0,mcyclecfgh
631+
[ ]+[0-9a-f]+:[ ]+72159073[ ]+csrw[ ]+mcyclecfgh,a1
632+
[ ]+[0-9a-f]+:[ ]+72202573[ ]+csrr[ ]+a0,minstretcfgh
633+
[ ]+[0-9a-f]+:[ ]+72259073[ ]+csrw[ ]+minstretcfgh,a1
626634
[ ]+[0-9a-f]+:[ ]+30c02573[ ]+csrr[ ]+a0,mstateen0
627635
[ ]+[0-9a-f]+:[ ]+30c59073[ ]+csrw[ ]+mstateen0,a1
628636
[ ]+[0-9a-f]+:[ ]+30d02573[ ]+csrr[ ]+a0,mstateen1
@@ -783,6 +791,10 @@ Disassembly of section .text:
783791
[ ]+[0-9a-f]+:[ ]+34359073[ ]+csrw[ ]+mtval,a1
784792
[ ]+[0-9a-f]+:[ ]+32002573[ ]+csrr[ ]+a0,0x320
785793
[ ]+[0-9a-f]+:[ ]+32059073[ ]+csrw[ ]+0x320,a1
794+
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,mcyclecfg
795+
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+mcyclecfg,a1
796+
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,minstretcfg
797+
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+minstretcfg,a1
786798
[ ]+[0-9a-f]+:[ ]+38002573[ ]+csrr[ ]+a0,0x380
787799
[ ]+[0-9a-f]+:[ ]+38059073[ ]+csrw[ ]+0x380,a1
788800
[ ]+[0-9a-f]+:[ ]+38102573[ ]+csrr[ ]+a0,0x381
@@ -795,10 +807,6 @@ Disassembly of section .text:
795807
[ ]+[0-9a-f]+:[ ]+38459073[ ]+csrw[ ]+0x384,a1
796808
[ ]+[0-9a-f]+:[ ]+38502573[ ]+csrr[ ]+a0,0x385
797809
[ ]+[0-9a-f]+:[ ]+38559073[ ]+csrw[ ]+0x385,a1
798-
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,0x321
799-
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+0x321,a1
800-
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,0x322
801-
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+0x322,a1
802810
[ ]+[0-9a-f]+:[ ]+00002573[ ]+csrr[ ]+a0,ustatus
803811
[ ]+[0-9a-f]+:[ ]+00059073[ ]+csrw[ ]+ustatus,a1
804812
[ ]+[0-9a-f]+:[ ]+00402573[ ]+csrr[ ]+a0,uie

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,30 @@
889889
.*Info: macro .*
890890
.*Warning: invalid CSR `miph', needs `smaia' extension
891891
.*Info: macro .*
892+
.*Warning: invalid CSR `mcyclecfg', needs `smcntrpmf' extension
893+
.*Info: macro .*
894+
.*Warning: invalid CSR `mcyclecfg', needs `smcntrpmf' extension
895+
.*Info: macro .*
896+
.*Warning: invalid CSR `minstretcfg', needs `smcntrpmf' extension
897+
.*Info: macro .*
898+
.*Warning: invalid CSR `minstretcfg', needs `smcntrpmf' extension
899+
.*Info: macro .*
900+
.*Warning: invalid CSR `mcyclecfgh', needs rv32i extension
901+
.*Info: macro .*
902+
.*Warning: invalid CSR `mcyclecfgh', needs `smcntrpmf' extension
903+
.*Info: macro .*
904+
.*Warning: invalid CSR `mcyclecfgh', needs rv32i extension
905+
.*Info: macro .*
906+
.*Warning: invalid CSR `mcyclecfgh', needs `smcntrpmf' extension
907+
.*Info: macro .*
908+
.*Warning: invalid CSR `minstretcfgh', needs rv32i extension
909+
.*Info: macro .*
910+
.*Warning: invalid CSR `minstretcfgh', needs `smcntrpmf' extension
911+
.*Info: macro .*
912+
.*Warning: invalid CSR `minstretcfgh', needs rv32i extension
913+
.*Info: macro .*
914+
.*Warning: invalid CSR `minstretcfgh', needs `smcntrpmf' extension
915+
.*Info: macro .*
892916
.*Warning: invalid CSR `mstateen0', needs `smstateen' extension
893917
.*Info: macro .*
894918
.*Warning: invalid CSR `mstateen0', needs `smstateen' extension
@@ -1507,6 +1531,14 @@
15071531
.*Info: macro .*
15081532
.*Warning: invalid CSR `mucounteren' for the privileged spec `1.10'
15091533
.*Info: macro .*
1534+
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.10'
1535+
.*Info: macro .*
1536+
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.10'
1537+
.*Info: macro .*
1538+
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.10'
1539+
.*Info: macro .*
1540+
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.10'
1541+
.*Info: macro .*
15101542
.*Warning: invalid CSR `mbase' for the privileged spec `1.10'
15111543
.*Info: macro .*
15121544
.*Warning: invalid CSR `mbase' for the privileged spec `1.10'
@@ -1531,14 +1563,6 @@
15311563
.*Info: macro .*
15321564
.*Warning: invalid CSR `mdbound' for the privileged spec `1.10'
15331565
.*Info: macro .*
1534-
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.10'
1535-
.*Info: macro .*
1536-
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.10'
1537-
.*Info: macro .*
1538-
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.10'
1539-
.*Info: macro .*
1540-
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.10'
1541-
.*Info: macro .*
15421566
.*Warning: invalid CSR `fflags', needs `f' extension
15431567
.*Info: macro .*
15441568
.*Warning: invalid CSR `fflags', needs `f' extension

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,14 @@ Disassembly of section .text:
623623
[ ]+[0-9a-f]+:[ ]+31959073[ ]+csrw[ ]+mviph,a1
624624
[ ]+[0-9a-f]+:[ ]+35402573[ ]+csrr[ ]+a0,miph
625625
[ ]+[0-9a-f]+:[ ]+35459073[ ]+csrw[ ]+miph,a1
626+
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,mcyclecfg
627+
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+mcyclecfg,a1
628+
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,minstretcfg
629+
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+minstretcfg,a1
630+
[ ]+[0-9a-f]+:[ ]+72102573[ ]+csrr[ ]+a0,mcyclecfgh
631+
[ ]+[0-9a-f]+:[ ]+72159073[ ]+csrw[ ]+mcyclecfgh,a1
632+
[ ]+[0-9a-f]+:[ ]+72202573[ ]+csrr[ ]+a0,minstretcfgh
633+
[ ]+[0-9a-f]+:[ ]+72259073[ ]+csrw[ ]+minstretcfgh,a1
626634
[ ]+[0-9a-f]+:[ ]+30c02573[ ]+csrr[ ]+a0,mstateen0
627635
[ ]+[0-9a-f]+:[ ]+30c59073[ ]+csrw[ ]+mstateen0,a1
628636
[ ]+[0-9a-f]+:[ ]+30d02573[ ]+csrr[ ]+a0,mstateen1
@@ -783,6 +791,10 @@ Disassembly of section .text:
783791
[ ]+[0-9a-f]+:[ ]+34359073[ ]+csrw[ ]+mtval,a1
784792
[ ]+[0-9a-f]+:[ ]+32002573[ ]+csrr[ ]+a0,mcountinhibit
785793
[ ]+[0-9a-f]+:[ ]+32059073[ ]+csrw[ ]+mcountinhibit,a1
794+
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,mcyclecfg
795+
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+mcyclecfg,a1
796+
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,minstretcfg
797+
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+minstretcfg,a1
786798
[ ]+[0-9a-f]+:[ ]+38002573[ ]+csrr[ ]+a0,0x380
787799
[ ]+[0-9a-f]+:[ ]+38059073[ ]+csrw[ ]+0x380,a1
788800
[ ]+[0-9a-f]+:[ ]+38102573[ ]+csrr[ ]+a0,0x381
@@ -795,10 +807,6 @@ Disassembly of section .text:
795807
[ ]+[0-9a-f]+:[ ]+38459073[ ]+csrw[ ]+0x384,a1
796808
[ ]+[0-9a-f]+:[ ]+38502573[ ]+csrr[ ]+a0,0x385
797809
[ ]+[0-9a-f]+:[ ]+38559073[ ]+csrw[ ]+0x385,a1
798-
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,0x321
799-
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+0x321,a1
800-
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,0x322
801-
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+0x322,a1
802810
[ ]+[0-9a-f]+:[ ]+00002573[ ]+csrr[ ]+a0,ustatus
803811
[ ]+[0-9a-f]+:[ ]+00059073[ ]+csrw[ ]+ustatus,a1
804812
[ ]+[0-9a-f]+:[ ]+00402573[ ]+csrr[ ]+a0,uie

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,30 @@
885885
.*Info: macro .*
886886
.*Warning: invalid CSR `miph', needs `smaia' extension
887887
.*Info: macro .*
888+
.*Warning: invalid CSR `mcyclecfg', needs `smcntrpmf' extension
889+
.*Info: macro .*
890+
.*Warning: invalid CSR `mcyclecfg', needs `smcntrpmf' extension
891+
.*Info: macro .*
892+
.*Warning: invalid CSR `minstretcfg', needs `smcntrpmf' extension
893+
.*Info: macro .*
894+
.*Warning: invalid CSR `minstretcfg', needs `smcntrpmf' extension
895+
.*Info: macro .*
896+
.*Warning: invalid CSR `mcyclecfgh', needs rv32i extension
897+
.*Info: macro .*
898+
.*Warning: invalid CSR `mcyclecfgh', needs `smcntrpmf' extension
899+
.*Info: macro .*
900+
.*Warning: invalid CSR `mcyclecfgh', needs rv32i extension
901+
.*Info: macro .*
902+
.*Warning: invalid CSR `mcyclecfgh', needs `smcntrpmf' extension
903+
.*Info: macro .*
904+
.*Warning: invalid CSR `minstretcfgh', needs rv32i extension
905+
.*Info: macro .*
906+
.*Warning: invalid CSR `minstretcfgh', needs `smcntrpmf' extension
907+
.*Info: macro .*
908+
.*Warning: invalid CSR `minstretcfgh', needs rv32i extension
909+
.*Info: macro .*
910+
.*Warning: invalid CSR `minstretcfgh', needs `smcntrpmf' extension
911+
.*Info: macro .*
888912
.*Warning: invalid CSR `mstateen0', needs `smstateen' extension
889913
.*Info: macro .*
890914
.*Warning: invalid CSR `mstateen0', needs `smstateen' extension
@@ -1503,6 +1527,14 @@
15031527
.*Info: macro .*
15041528
.*Warning: invalid CSR `mucounteren' for the privileged spec `1.11'
15051529
.*Info: macro .*
1530+
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.11'
1531+
.*Info: macro .*
1532+
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.11'
1533+
.*Info: macro .*
1534+
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.11'
1535+
.*Info: macro .*
1536+
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.11'
1537+
.*Info: macro .*
15061538
.*Warning: invalid CSR `mbase' for the privileged spec `1.11'
15071539
.*Info: macro .*
15081540
.*Warning: invalid CSR `mbase' for the privileged spec `1.11'
@@ -1527,14 +1559,6 @@
15271559
.*Info: macro .*
15281560
.*Warning: invalid CSR `mdbound' for the privileged spec `1.11'
15291561
.*Info: macro .*
1530-
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.11'
1531-
.*Info: macro .*
1532-
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.11'
1533-
.*Info: macro .*
1534-
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.11'
1535-
.*Info: macro .*
1536-
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.11'
1537-
.*Info: macro .*
15381562
.*Warning: invalid CSR `fflags', needs `f' extension
15391563
.*Info: macro .*
15401564
.*Warning: invalid CSR `fflags', needs `f' extension

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,14 @@ Disassembly of section .text:
623623
[ ]+[0-9a-f]+:[ ]+31959073[ ]+csrw[ ]+mviph,a1
624624
[ ]+[0-9a-f]+:[ ]+35402573[ ]+csrr[ ]+a0,miph
625625
[ ]+[0-9a-f]+:[ ]+35459073[ ]+csrw[ ]+miph,a1
626+
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,mcyclecfg
627+
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+mcyclecfg,a1
628+
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,minstretcfg
629+
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+minstretcfg,a1
630+
[ ]+[0-9a-f]+:[ ]+72102573[ ]+csrr[ ]+a0,mcyclecfgh
631+
[ ]+[0-9a-f]+:[ ]+72159073[ ]+csrw[ ]+mcyclecfgh,a1
632+
[ ]+[0-9a-f]+:[ ]+72202573[ ]+csrr[ ]+a0,minstretcfgh
633+
[ ]+[0-9a-f]+:[ ]+72259073[ ]+csrw[ ]+minstretcfgh,a1
626634
[ ]+[0-9a-f]+:[ ]+30c02573[ ]+csrr[ ]+a0,mstateen0
627635
[ ]+[0-9a-f]+:[ ]+30c59073[ ]+csrw[ ]+mstateen0,a1
628636
[ ]+[0-9a-f]+:[ ]+30d02573[ ]+csrr[ ]+a0,mstateen1
@@ -783,6 +791,10 @@ Disassembly of section .text:
783791
[ ]+[0-9a-f]+:[ ]+34359073[ ]+csrw[ ]+mtval,a1
784792
[ ]+[0-9a-f]+:[ ]+32002573[ ]+csrr[ ]+a0,mcountinhibit
785793
[ ]+[0-9a-f]+:[ ]+32059073[ ]+csrw[ ]+mcountinhibit,a1
794+
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,mcyclecfg
795+
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+mcyclecfg,a1
796+
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,minstretcfg
797+
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+minstretcfg,a1
786798
[ ]+[0-9a-f]+:[ ]+38002573[ ]+csrr[ ]+a0,0x380
787799
[ ]+[0-9a-f]+:[ ]+38059073[ ]+csrw[ ]+0x380,a1
788800
[ ]+[0-9a-f]+:[ ]+38102573[ ]+csrr[ ]+a0,0x381
@@ -795,10 +807,6 @@ Disassembly of section .text:
795807
[ ]+[0-9a-f]+:[ ]+38459073[ ]+csrw[ ]+0x384,a1
796808
[ ]+[0-9a-f]+:[ ]+38502573[ ]+csrr[ ]+a0,0x385
797809
[ ]+[0-9a-f]+:[ ]+38559073[ ]+csrw[ ]+0x385,a1
798-
[ ]+[0-9a-f]+:[ ]+32102573[ ]+csrr[ ]+a0,0x321
799-
[ ]+[0-9a-f]+:[ ]+32159073[ ]+csrw[ ]+0x321,a1
800-
[ ]+[0-9a-f]+:[ ]+32202573[ ]+csrr[ ]+a0,0x322
801-
[ ]+[0-9a-f]+:[ ]+32259073[ ]+csrw[ ]+0x322,a1
802810
[ ]+[0-9a-f]+:[ ]+00002573[ ]+csrr[ ]+a0,0x0
803811
[ ]+[0-9a-f]+:[ ]+00059073[ ]+csrw[ ]+0x0,a1
804812
[ ]+[0-9a-f]+:[ ]+00402573[ ]+csrr[ ]+a0,0x4

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,30 @@
609609
.*Info: macro .*
610610
.*Warning: invalid CSR `miph', needs `smaia' extension
611611
.*Info: macro .*
612+
.*Warning: invalid CSR `mcyclecfg', needs `smcntrpmf' extension
613+
.*Info: macro .*
614+
.*Warning: invalid CSR `mcyclecfg', needs `smcntrpmf' extension
615+
.*Info: macro .*
616+
.*Warning: invalid CSR `minstretcfg', needs `smcntrpmf' extension
617+
.*Info: macro .*
618+
.*Warning: invalid CSR `minstretcfg', needs `smcntrpmf' extension
619+
.*Info: macro .*
620+
.*Warning: invalid CSR `mcyclecfgh', needs rv32i extension
621+
.*Info: macro .*
622+
.*Warning: invalid CSR `mcyclecfgh', needs `smcntrpmf' extension
623+
.*Info: macro .*
624+
.*Warning: invalid CSR `mcyclecfgh', needs rv32i extension
625+
.*Info: macro .*
626+
.*Warning: invalid CSR `mcyclecfgh', needs `smcntrpmf' extension
627+
.*Info: macro .*
628+
.*Warning: invalid CSR `minstretcfgh', needs rv32i extension
629+
.*Info: macro .*
630+
.*Warning: invalid CSR `minstretcfgh', needs `smcntrpmf' extension
631+
.*Info: macro .*
632+
.*Warning: invalid CSR `minstretcfgh', needs rv32i extension
633+
.*Info: macro .*
634+
.*Warning: invalid CSR `minstretcfgh', needs `smcntrpmf' extension
635+
.*Info: macro .*
612636
.*Warning: invalid CSR `mstateen0', needs `smstateen' extension
613637
.*Info: macro .*
614638
.*Warning: invalid CSR `mstateen0', needs `smstateen' extension
@@ -1227,6 +1251,14 @@
12271251
.*Info: macro .*
12281252
.*Warning: invalid CSR `mucounteren' for the privileged spec `1.12'
12291253
.*Info: macro .*
1254+
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.12'
1255+
.*Info: macro .*
1256+
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.12'
1257+
.*Info: macro .*
1258+
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.12'
1259+
.*Info: macro .*
1260+
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.12'
1261+
.*Info: macro .*
12301262
.*Warning: invalid CSR `mbase' for the privileged spec `1.12'
12311263
.*Info: macro .*
12321264
.*Warning: invalid CSR `mbase' for the privileged spec `1.12'
@@ -1251,14 +1283,6 @@
12511283
.*Info: macro .*
12521284
.*Warning: invalid CSR `mdbound' for the privileged spec `1.12'
12531285
.*Info: macro .*
1254-
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.12'
1255-
.*Info: macro .*
1256-
.*Warning: invalid CSR `mscounteren' for the privileged spec `1.12'
1257-
.*Info: macro .*
1258-
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.12'
1259-
.*Info: macro .*
1260-
.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.12'
1261-
.*Info: macro .*
12621286
.*Warning: invalid CSR `ustatus' for the privileged spec `1.12'
12631287
.*Info: macro .*
12641288
.*Warning: invalid CSR `ustatus' for the privileged spec `1.12'

0 commit comments

Comments
 (0)