[PATCH] riscv: Add AIA extension support (Smaia, Ssaia)

Christoph Müllner christoph.muellner@vrull.eu
Thu Aug 25 19:11:42 GMT 2022


On Thu, Aug 25, 2022 at 8:05 PM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> On Thu, 25 Aug 2022 08:16:37 PDT (-0700), christoph.muellner@vrull.eu wrote:
> > Forwarding to Nelson's new email address.
> >
> > On Thu, Aug 25, 2022 at 4:54 PM Christoph Muellner
> > <christoph.muellner@vrull.eu> wrote:
> >>
> >> From: Christoph Müllner <christoph.muellner@vrull.eu>
> >>
> >> This commit adds the AIA extensions (Smaia and Ssaia).
> >>
> >> bfd/ChangeLog:
> >>
> >>         * elfxx-riscv.c: Add 'smaia' and 'ssaia' to the list
> >>         of known standard extensions.
> >>
> >> gas/ChangeLog:
> >>
> >>         * config/tc-riscv.c (enum riscv_csr_class):
> >>         (riscv_csr_address): Add CSR classes for Smaia/Ssaia.
> >>         * testsuite/gas/riscv/csr-dw-regnums.d: Add new CSRs.
> >>         * testsuite/gas/riscv/csr-dw-regnums.s: 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.
> >>         * testsuite/gas/riscv/csr-version-1p9p1.d: Likewise.
> >>         * testsuite/gas/riscv/csr-version-1p9p1.l: Likewise.
> >>         * testsuite/gas/riscv/csr.s: Likewise.
> >>
> >> include/ChangeLog:
> >>
> >>         * opcode/riscv-opc.h (CSR_MISELECT): New CSR marcro.
> >>         (CSR_MIREG): Likewise.
> >>         (CSR_MTOPEI): Likewise.
> >>         (CSR_MTOPI): Likewise.
> >>         (CSR_MVIEN): Likewise.
> >>         (CSR_MVIP): Likewise.
> >>         (CSR_MIDELEGH): Likewise.
> >>         (CSR_MIEH): Likewise.
> >>         (CSR_MVIENH): Likewise.
> >>         (CSR_MVIPH): Likewise.
> >>         (CSR_MIPH): Likewise.
> >>         (CSR_SISELECT): Likewise.
> >>         (CSR_SIREG): Likewise.
> >>         (CSR_STOPEI): Likewise.
> >>         (CSR_STOPI): Likewise.
> >>         (CSR_SIEH): Likewise.
> >>         (CSR_SIPH): Likewise.
> >>         (DECLARE_CSR): Likewise.
> >> ---
> >>  bfd/elfxx-riscv.c                           |  2 +
> >>  gas/config/tc-riscv.c                       | 16 ++++++-
> >>  gas/testsuite/gas/riscv/csr-dw-regnums.d    | 17 +++++++
> >>  gas/testsuite/gas/riscv/csr-dw-regnums.s    | 21 +++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p10.d  | 34 ++++++++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p10.l  | 50 +++++++++++++++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p11.d  | 34 ++++++++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p11.l  | 50 +++++++++++++++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p12.d  | 34 ++++++++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p12.l  | 50 +++++++++++++++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p9p1.d | 34 ++++++++++++++
> >>  gas/testsuite/gas/riscv/csr-version-1p9p1.l | 50 +++++++++++++++++++++
> >>  gas/testsuite/gas/riscv/csr.s               | 21 +++++++++
> >>  include/opcode/riscv-opc.h                  | 38 ++++++++++++++++
> >>  14 files changed, 450 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
> >> index c9636bcbdc8..34ae84e18bd 100644
> >> --- a/bfd/elfxx-riscv.c
> >> +++ b/bfd/elfxx-riscv.c
> >> @@ -1207,7 +1207,9 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
> >>
> >>  static struct riscv_supported_ext riscv_supported_std_s_ext[] =
> >>  {
> >> +  {"smaia",            ISA_SPEC_CLASS_DRAFT,           1, 0, 0 },
> >>    {"smstateen",                ISA_SPEC_CLASS_DRAFT,           1, 0, 0 },
> >> +  {"ssaia",            ISA_SPEC_CLASS_DRAFT,           1, 0, 0 },
.>
> The latest AIA spec release I can find is "0.3.1-draft.32"
> <https://github.com/riscv/riscv-aia/releases/tag/0.3.1-draft.32>, which
> lists a handful of subsets as "stable" but other as "draft".  Is there a
> frozen version of this somewhere?  The "stable" designation in RISC-V
> land doesn't really mean anything.

The specification states (maintained by the RVI program managers) can
be found here:
  https://wiki.riscv.org/display/HOME/Specification+Status
The AIA specification is in the state "Freeze Arch Review Complete"
with version "0.3.1-draft.32".
However, the public review period has not started yet.
I assume this will happen in the next 1-2 weeks (Anup probably knows better).
Ratification will then happen after the 45 days public review period.
Would the beginning of the public review period be acceptable for merging?

This patch needs a v2 anyway because I missed the Hypervisor and VS CSRs.

BR
Christoph




>
> >>    {"sscofpmf",         ISA_SPEC_CLASS_DRAFT,           1, 0, 0 },
> >>    {"sstc",             ISA_SPEC_CLASS_DRAFT,           1, 0, 0 },
> >>    {"svinval",          ISA_SPEC_CLASS_DRAFT,           1, 0, 0 },
> >> diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
> >> index 34ce68e8252..42d23bb200a 100644
> >> --- a/gas/config/tc-riscv.c
> >> +++ b/gas/config/tc-riscv.c
> >> @@ -68,10 +68,14 @@ enum riscv_csr_class
> >>    CSR_CLASS_DEBUG,     /* debug CSR */
> >>    CSR_CLASS_H,         /* hypervisor */
> >>    CSR_CLASS_H_32,      /* hypervisor, rv32 only */
> >> +  CSR_CLASS_SMAIA,             /* Smaia */
> >> +  CSR_CLASS_SMAIA_32,          /* Smaia, rv32 only */
> >>    CSR_CLASS_SMSTATEEN,         /* Smstateen only */
> >>    CSR_CLASS_SMSTATEEN_AND_H,   /* Smstateen only (with H) */
> >>    CSR_CLASS_SMSTATEEN_32,      /* Smstateen RV32 only */
> >>    CSR_CLASS_SMSTATEEN_AND_H_32,        /* Smstateen RV32 only (with H) */
> >> +  CSR_CLASS_SSAIA,             /* Ssaia */
> >> +  CSR_CLASS_SSAIA_32,          /* Ssaia, rv32 only */
> >>    CSR_CLASS_SSCOFPMF,          /* Sscofpmf only */
> >>    CSR_CLASS_SSCOFPMF_32,       /* Sscofpmf RV32 only */
> >>    CSR_CLASS_SSTC,              /* Sstc only */
> >> @@ -937,6 +941,11 @@ riscv_csr_address (const char *csr_name,
> >>      case CSR_CLASS_V:
> >>        extension = "v";
> >>        break;
> >> +    case CSR_CLASS_SMAIA:
> >> +    case CSR_CLASS_SMAIA_32:
> >> +      is_rv32_only = (csr_class == CSR_CLASS_SMAIA_32);
> >> +      extension = "smaia";
> >> +      break;
> >>      case CSR_CLASS_SMSTATEEN:
> >>      case CSR_CLASS_SMSTATEEN_AND_H:
> >>      case CSR_CLASS_SMSTATEEN_32:
> >> @@ -947,7 +956,12 @@ riscv_csr_address (const char *csr_name,
> >>                       || csr_class == CSR_CLASS_SMSTATEEN_AND_H_32);
> >>        extension = "smstateen";
> >>        break;
> >> -    case CSR_CLASS_SSCOFPMF_32:
> >> +    case CSR_CLASS_SSAIA:
> >> +    case CSR_CLASS_SSAIA_32:
> >> +      is_rv32_only = (csr_class == CSR_CLASS_SSAIA_32);
> >> +      extension = "ssaia";
> >> +      break;
> >> +     case CSR_CLASS_SSCOFPMF_32:
> >>        is_rv32_only = true;
> >>        /* Fall through.  */
> >>      case CSR_CLASS_SSCOFPMF:
> >> diff --git a/gas/testsuite/gas/riscv/csr-dw-regnums.d b/gas/testsuite/gas/riscv/csr-dw-regnums.d
> >> index b4b3806a085..0c9386dfd18 100644
> >> --- a/gas/testsuite/gas/riscv/csr-dw-regnums.d
> >> +++ b/gas/testsuite/gas/riscv/csr-dw-regnums.d
> >> @@ -313,6 +313,17 @@ Contents of the .* section:
> >>    DW_CFA_offset_extended_sf: r4675 \(vstval\) at cfa\+2316
> >>    DW_CFA_offset_extended_sf: r4676 \(vsip\) at cfa\+2320
> >>    DW_CFA_offset_extended_sf: r4736 \(vsatp\) at cfa\+2560
> >> +  DW_CFA_offset_extended_sf: r4944 \(miselect\) at cfa\+3392
> >> +  DW_CFA_offset_extended_sf: r4945 \(mireg\) at cfa\+3396
> >> +  DW_CFA_offset_extended_sf: r4956 \(mtopei\) at cfa\+3440
> >> +  DW_CFA_offset_extended_sf: r8112 \(mtopi\) at cfa\+16064
> >> +  DW_CFA_offset_extended_sf: r4872 \(mvien\) at cfa\+3104
> >> +  DW_CFA_offset_extended_sf: r4873 \(mvip\) at cfa\+3108
> >> +  DW_CFA_offset_extended_sf: r4883 \(midelegh\) at cfa\+3148
> >> +  DW_CFA_offset_extended_sf: r4884 \(mieh\) at cfa\+3152
> >> +  DW_CFA_offset_extended_sf: r4888 \(mvienh\) at cfa\+3168
> >> +  DW_CFA_offset_extended_sf: r4889 \(mviph\) at cfa\+3172
> >> +  DW_CFA_offset_extended_sf: r4948 \(miph\) at cfa\+3408
> >>    DW_CFA_offset_extended_sf: r4876 \(mstateen0\) at cfa\+3120
> >>    DW_CFA_offset_extended_sf: r4877 \(mstateen1\) at cfa\+3124
> >>    DW_CFA_offset_extended_sf: r4878 \(mstateen2\) at cfa\+3128
> >> @@ -333,6 +344,12 @@ Contents of the .* section:
> >>    DW_CFA_offset_extended_sf: r5661 \(hstateen1h\) at cfa\+6260
> >>    DW_CFA_offset_extended_sf: r5662 \(hstateen2h\) at cfa\+6264
> >>    DW_CFA_offset_extended_sf: r5663 \(hstateen3h\) at cfa\+6268
> >> +  DW_CFA_offset_extended_sf: r4432 \(siselect\) at cfa\+1344
> >> +  DW_CFA_offset_extended_sf: r4433 \(sireg\) at cfa\+1348
> >> +  DW_CFA_offset_extended_sf: r4444 \(stopei\) at cfa\+1392
> >> +  DW_CFA_offset_extended_sf: r7600 \(stopi\) at cfa\+14016
> >> +  DW_CFA_offset_extended_sf: r4372 \(sieh\) at cfa\+1104
> >> +  DW_CFA_offset_extended_sf: r4436 \(siph\) at cfa\+1360
> >>    DW_CFA_offset_extended_sf: r7584 \(scountovf\) at cfa\+13952
> >>    DW_CFA_offset_extended_sf: r5923 \(mhpmevent3h\) at cfa\+7308
> >>    DW_CFA_offset_extended_sf: r5924 \(mhpmevent4h\) at cfa\+7312
> >> diff --git a/gas/testsuite/gas/riscv/csr-dw-regnums.s b/gas/testsuite/gas/riscv/csr-dw-regnums.s
> >> index 6cfa415ebc2..c57825a961d 100644
> >> --- a/gas/testsuite/gas/riscv/csr-dw-regnums.s
> >> +++ b/gas/testsuite/gas/riscv/csr-dw-regnums.s
> >> @@ -1,6 +1,8 @@
> >>  # Check that CFI directives can accept all of the CSR names (including
> >>  # aliases).  The results for this test also ensures that the DWARF
> >>  # register numbers for the CSRs shouldn't change.
> >> +# The register numbers are specified to be CSR-ID + 4096 (see psABI spec).
> >> +# The CFI offsets in this file are CSR-ID x 4.
> >>
> >>         .text
> >>         .global _start
> >> @@ -307,6 +309,18 @@ _start:
> >>         .cfi_offset vstval, 2316
> >>         .cfi_offset vsip, 2320
> >>         .cfi_offset vsatp, 2560
> >> +       # Smaia extension
> >> +       .cfi_offset miselect, 3392
> >> +       .cfi_offset mireg, 3396
> >> +       .cfi_offset mtopei, 3440
> >> +       .cfi_offset mtopi, 16064
> >> +       .cfi_offset mvien, 3104
> >> +       .cfi_offset mvip, 3108
> >> +       .cfi_offset midelegh, 3148
> >> +       .cfi_offset mieh, 3152
> >> +       .cfi_offset mvienh, 3168
> >> +       .cfi_offset mviph, 3172
> >> +       .cfi_offset miph, 3408
> >>         # Smstateen extension
> >>         .cfi_offset mstateen0, 3120
> >>         .cfi_offset mstateen1, 3124
> >> @@ -328,6 +342,13 @@ _start:
> >>         .cfi_offset hstateen1h, 6260
> >>         .cfi_offset hstateen2h, 6264
> >>         .cfi_offset hstateen3h, 6268
> >> +       # Ssaia extension
> >> +       .cfi_offset siselect, 1344
> >> +       .cfi_offset sireg, 1348
> >> +       .cfi_offset stopei, 1392
> >> +       .cfi_offset stopi, 14016
> >> +       .cfi_offset sieh, 1104
> >> +       .cfi_offset siph, 1360
> >>         # Sscofpmf extension
> >>         .cfi_offset scountovf, 13952
> >>         .cfi_offset mhpmevent3h, 7308
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.d b/gas/testsuite/gas/riscv/csr-version-1p10.d
> >> index bd8b10302e3..ab6ace32846 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p10.d
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p10.d
> >> @@ -601,6 +601,28 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+24459073[     ]+csrw[         ]+vsip,a1
> >>  [      ]+[0-9a-f]+:[   ]+28002573[     ]+csrr[         ]+a0,vsatp
> >>  [      ]+[0-9a-f]+:[   ]+28059073[     ]+csrw[         ]+vsatp,a1
> >> +[      ]+[0-9a-f]+:[   ]+35002573[     ]+csrr[         ]+a0,miselect
> >> +[      ]+[0-9a-f]+:[   ]+35059073[     ]+csrw[         ]+miselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+35102573[     ]+csrr[         ]+a0,mireg
> >> +[      ]+[0-9a-f]+:[   ]+35159073[     ]+csrw[         ]+mireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+35c02573[     ]+csrr[         ]+a0,mtopei
> >> +[      ]+[0-9a-f]+:[   ]+35c59073[     ]+csrw[         ]+mtopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+fb002573[     ]+csrr[         ]+a0,mtopi
> >> +[      ]+[0-9a-f]+:[   ]+fb059073[     ]+csrw[         ]+mtopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+30802573[     ]+csrr[         ]+a0,mvien
> >> +[      ]+[0-9a-f]+:[   ]+30859073[     ]+csrw[         ]+mvien,a1
> >> +[      ]+[0-9a-f]+:[   ]+30902573[     ]+csrr[         ]+a0,mvip
> >> +[      ]+[0-9a-f]+:[   ]+30959073[     ]+csrw[         ]+mvip,a1
> >> +[      ]+[0-9a-f]+:[   ]+31302573[     ]+csrr[         ]+a0,midelegh
> >> +[      ]+[0-9a-f]+:[   ]+31359073[     ]+csrw[         ]+midelegh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31402573[     ]+csrr[         ]+a0,mieh
> >> +[      ]+[0-9a-f]+:[   ]+31459073[     ]+csrw[         ]+mieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31802573[     ]+csrr[         ]+a0,mvienh
> >> +[      ]+[0-9a-f]+:[   ]+31859073[     ]+csrw[         ]+mvienh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31902573[     ]+csrr[         ]+a0,mviph
> >> +[      ]+[0-9a-f]+:[   ]+31959073[     ]+csrw[         ]+mviph,a1
> >> +[      ]+[0-9a-f]+:[   ]+35402573[     ]+csrr[         ]+a0,miph
> >> +[      ]+[0-9a-f]+:[   ]+35459073[     ]+csrw[         ]+miph,a1
> >>  [      ]+[0-9a-f]+:[   ]+30c02573[     ]+csrr[         ]+a0,mstateen0
> >>  [      ]+[0-9a-f]+:[   ]+30c59073[     ]+csrw[         ]+mstateen0,a1
> >>  [      ]+[0-9a-f]+:[   ]+30d02573[     ]+csrr[         ]+a0,mstateen1
> >> @@ -641,6 +663,18 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+61e59073[     ]+csrw[         ]+hstateen2h,a1
> >>  [      ]+[0-9a-f]+:[   ]+61f02573[     ]+csrr[         ]+a0,hstateen3h
> >>  [      ]+[0-9a-f]+:[   ]+61f59073[     ]+csrw[         ]+hstateen3h,a1
> >> +[      ]+[0-9a-f]+:[   ]+15002573[     ]+csrr[         ]+a0,siselect
> >> +[      ]+[0-9a-f]+:[   ]+15059073[     ]+csrw[         ]+siselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+15102573[     ]+csrr[         ]+a0,sireg
> >> +[      ]+[0-9a-f]+:[   ]+15159073[     ]+csrw[         ]+sireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+15c02573[     ]+csrr[         ]+a0,stopei
> >> +[      ]+[0-9a-f]+:[   ]+15c59073[     ]+csrw[         ]+stopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+db002573[     ]+csrr[         ]+a0,stopi
> >> +[      ]+[0-9a-f]+:[   ]+db059073[     ]+csrw[         ]+stopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+11402573[     ]+csrr[         ]+a0,sieh
> >> +[      ]+[0-9a-f]+:[   ]+11459073[     ]+csrw[         ]+sieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+15402573[     ]+csrr[         ]+a0,siph
> >> +[      ]+[0-9a-f]+:[   ]+15459073[     ]+csrw[         ]+siph,a1
> >>  [      ]+[0-9a-f]+:[   ]+da002573[     ]+csrr[         ]+a0,scountovf
> >>  [      ]+[0-9a-f]+:[   ]+da059073[     ]+csrw[         ]+scountovf,a1
> >>  [      ]+[0-9a-f]+:[   ]+72302573[     ]+csrr[         ]+a0,mhpmevent3h
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.l b/gas/testsuite/gas/riscv/csr-version-1p10.l
> >> index b778453b556..b4d12541b49 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p10.l
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p10.l
> >> @@ -411,6 +411,39 @@
> >>  .*Warning: invalid CSR `vsip', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: read-only CSR is written `csrw mtopi,a1'
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen1', needs `smstateen' extension
> >> @@ -483,6 +516,23 @@
> >>  .*Warning: invalid CSR `hstateen3h', needs rv32i extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `h' extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: read-only CSR is written `csrw stopi,a1'
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: read-only CSR is written `csrw scountovf,a1'
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.d b/gas/testsuite/gas/riscv/csr-version-1p11.d
> >> index 5d6333884f1..95ca52d6dc3 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p11.d
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p11.d
> >> @@ -601,6 +601,28 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+24459073[     ]+csrw[         ]+vsip,a1
> >>  [      ]+[0-9a-f]+:[   ]+28002573[     ]+csrr[         ]+a0,vsatp
> >>  [      ]+[0-9a-f]+:[   ]+28059073[     ]+csrw[         ]+vsatp,a1
> >> +[      ]+[0-9a-f]+:[   ]+35002573[     ]+csrr[         ]+a0,miselect
> >> +[      ]+[0-9a-f]+:[   ]+35059073[     ]+csrw[         ]+miselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+35102573[     ]+csrr[         ]+a0,mireg
> >> +[      ]+[0-9a-f]+:[   ]+35159073[     ]+csrw[         ]+mireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+35c02573[     ]+csrr[         ]+a0,mtopei
> >> +[      ]+[0-9a-f]+:[   ]+35c59073[     ]+csrw[         ]+mtopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+fb002573[     ]+csrr[         ]+a0,mtopi
> >> +[      ]+[0-9a-f]+:[   ]+fb059073[     ]+csrw[         ]+mtopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+30802573[     ]+csrr[         ]+a0,mvien
> >> +[      ]+[0-9a-f]+:[   ]+30859073[     ]+csrw[         ]+mvien,a1
> >> +[      ]+[0-9a-f]+:[   ]+30902573[     ]+csrr[         ]+a0,mvip
> >> +[      ]+[0-9a-f]+:[   ]+30959073[     ]+csrw[         ]+mvip,a1
> >> +[      ]+[0-9a-f]+:[   ]+31302573[     ]+csrr[         ]+a0,midelegh
> >> +[      ]+[0-9a-f]+:[   ]+31359073[     ]+csrw[         ]+midelegh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31402573[     ]+csrr[         ]+a0,mieh
> >> +[      ]+[0-9a-f]+:[   ]+31459073[     ]+csrw[         ]+mieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31802573[     ]+csrr[         ]+a0,mvienh
> >> +[      ]+[0-9a-f]+:[   ]+31859073[     ]+csrw[         ]+mvienh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31902573[     ]+csrr[         ]+a0,mviph
> >> +[      ]+[0-9a-f]+:[   ]+31959073[     ]+csrw[         ]+mviph,a1
> >> +[      ]+[0-9a-f]+:[   ]+35402573[     ]+csrr[         ]+a0,miph
> >> +[      ]+[0-9a-f]+:[   ]+35459073[     ]+csrw[         ]+miph,a1
> >>  [      ]+[0-9a-f]+:[   ]+30c02573[     ]+csrr[         ]+a0,mstateen0
> >>  [      ]+[0-9a-f]+:[   ]+30c59073[     ]+csrw[         ]+mstateen0,a1
> >>  [      ]+[0-9a-f]+:[   ]+30d02573[     ]+csrr[         ]+a0,mstateen1
> >> @@ -641,6 +663,18 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+61e59073[     ]+csrw[         ]+hstateen2h,a1
> >>  [      ]+[0-9a-f]+:[   ]+61f02573[     ]+csrr[         ]+a0,hstateen3h
> >>  [      ]+[0-9a-f]+:[   ]+61f59073[     ]+csrw[         ]+hstateen3h,a1
> >> +[      ]+[0-9a-f]+:[   ]+15002573[     ]+csrr[         ]+a0,siselect
> >> +[      ]+[0-9a-f]+:[   ]+15059073[     ]+csrw[         ]+siselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+15102573[     ]+csrr[         ]+a0,sireg
> >> +[      ]+[0-9a-f]+:[   ]+15159073[     ]+csrw[         ]+sireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+15c02573[     ]+csrr[         ]+a0,stopei
> >> +[      ]+[0-9a-f]+:[   ]+15c59073[     ]+csrw[         ]+stopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+db002573[     ]+csrr[         ]+a0,stopi
> >> +[      ]+[0-9a-f]+:[   ]+db059073[     ]+csrw[         ]+stopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+11402573[     ]+csrr[         ]+a0,sieh
> >> +[      ]+[0-9a-f]+:[   ]+11459073[     ]+csrw[         ]+sieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+15402573[     ]+csrr[         ]+a0,siph
> >> +[      ]+[0-9a-f]+:[   ]+15459073[     ]+csrw[         ]+siph,a1
> >>  [      ]+[0-9a-f]+:[   ]+da002573[     ]+csrr[         ]+a0,scountovf
> >>  [      ]+[0-9a-f]+:[   ]+da059073[     ]+csrw[         ]+scountovf,a1
> >>  [      ]+[0-9a-f]+:[   ]+72302573[     ]+csrr[         ]+a0,mhpmevent3h
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.l b/gas/testsuite/gas/riscv/csr-version-1p11.l
> >> index 78bae817470..96079a2937b 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p11.l
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p11.l
> >> @@ -409,6 +409,39 @@
> >>  .*Warning: invalid CSR `vsip', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: read-only CSR is written `csrw mtopi,a1'
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen1', needs `smstateen' extension
> >> @@ -481,6 +514,23 @@
> >>  .*Warning: invalid CSR `hstateen3h', needs rv32i extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `h' extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: read-only CSR is written `csrw stopi,a1'
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: read-only CSR is written `csrw scountovf,a1'
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.d b/gas/testsuite/gas/riscv/csr-version-1p12.d
> >> index 728e647c552..8d82c00471f 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p12.d
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p12.d
> >> @@ -601,6 +601,28 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+24459073[     ]+csrw[         ]+vsip,a1
> >>  [      ]+[0-9a-f]+:[   ]+28002573[     ]+csrr[         ]+a0,vsatp
> >>  [      ]+[0-9a-f]+:[   ]+28059073[     ]+csrw[         ]+vsatp,a1
> >> +[      ]+[0-9a-f]+:[   ]+35002573[     ]+csrr[         ]+a0,miselect
> >> +[      ]+[0-9a-f]+:[   ]+35059073[     ]+csrw[         ]+miselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+35102573[     ]+csrr[         ]+a0,mireg
> >> +[      ]+[0-9a-f]+:[   ]+35159073[     ]+csrw[         ]+mireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+35c02573[     ]+csrr[         ]+a0,mtopei
> >> +[      ]+[0-9a-f]+:[   ]+35c59073[     ]+csrw[         ]+mtopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+fb002573[     ]+csrr[         ]+a0,mtopi
> >> +[      ]+[0-9a-f]+:[   ]+fb059073[     ]+csrw[         ]+mtopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+30802573[     ]+csrr[         ]+a0,mvien
> >> +[      ]+[0-9a-f]+:[   ]+30859073[     ]+csrw[         ]+mvien,a1
> >> +[      ]+[0-9a-f]+:[   ]+30902573[     ]+csrr[         ]+a0,mvip
> >> +[      ]+[0-9a-f]+:[   ]+30959073[     ]+csrw[         ]+mvip,a1
> >> +[      ]+[0-9a-f]+:[   ]+31302573[     ]+csrr[         ]+a0,midelegh
> >> +[      ]+[0-9a-f]+:[   ]+31359073[     ]+csrw[         ]+midelegh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31402573[     ]+csrr[         ]+a0,mieh
> >> +[      ]+[0-9a-f]+:[   ]+31459073[     ]+csrw[         ]+mieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31802573[     ]+csrr[         ]+a0,mvienh
> >> +[      ]+[0-9a-f]+:[   ]+31859073[     ]+csrw[         ]+mvienh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31902573[     ]+csrr[         ]+a0,mviph
> >> +[      ]+[0-9a-f]+:[   ]+31959073[     ]+csrw[         ]+mviph,a1
> >> +[      ]+[0-9a-f]+:[   ]+35402573[     ]+csrr[         ]+a0,miph
> >> +[      ]+[0-9a-f]+:[   ]+35459073[     ]+csrw[         ]+miph,a1
> >>  [      ]+[0-9a-f]+:[   ]+30c02573[     ]+csrr[         ]+a0,mstateen0
> >>  [      ]+[0-9a-f]+:[   ]+30c59073[     ]+csrw[         ]+mstateen0,a1
> >>  [      ]+[0-9a-f]+:[   ]+30d02573[     ]+csrr[         ]+a0,mstateen1
> >> @@ -641,6 +663,18 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+61e59073[     ]+csrw[         ]+hstateen2h,a1
> >>  [      ]+[0-9a-f]+:[   ]+61f02573[     ]+csrr[         ]+a0,hstateen3h
> >>  [      ]+[0-9a-f]+:[   ]+61f59073[     ]+csrw[         ]+hstateen3h,a1
> >> +[      ]+[0-9a-f]+:[   ]+15002573[     ]+csrr[         ]+a0,siselect
> >> +[      ]+[0-9a-f]+:[   ]+15059073[     ]+csrw[         ]+siselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+15102573[     ]+csrr[         ]+a0,sireg
> >> +[      ]+[0-9a-f]+:[   ]+15159073[     ]+csrw[         ]+sireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+15c02573[     ]+csrr[         ]+a0,stopei
> >> +[      ]+[0-9a-f]+:[   ]+15c59073[     ]+csrw[         ]+stopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+db002573[     ]+csrr[         ]+a0,stopi
> >> +[      ]+[0-9a-f]+:[   ]+db059073[     ]+csrw[         ]+stopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+11402573[     ]+csrr[         ]+a0,sieh
> >> +[      ]+[0-9a-f]+:[   ]+11459073[     ]+csrw[         ]+sieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+15402573[     ]+csrr[         ]+a0,siph
> >> +[      ]+[0-9a-f]+:[   ]+15459073[     ]+csrw[         ]+siph,a1
> >>  [      ]+[0-9a-f]+:[   ]+da002573[     ]+csrr[         ]+a0,scountovf
> >>  [      ]+[0-9a-f]+:[   ]+da059073[     ]+csrw[         ]+scountovf,a1
> >>  [      ]+[0-9a-f]+:[   ]+72302573[     ]+csrr[         ]+a0,mhpmevent3h
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.l b/gas/testsuite/gas/riscv/csr-version-1p12.l
> >> index cb026bb55e0..34d6e004f37 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p12.l
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p12.l
> >> @@ -271,6 +271,39 @@
> >>  .*Warning: invalid CSR `vsip', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: read-only CSR is written `csrw mtopi,a1'
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen1', needs `smstateen' extension
> >> @@ -343,6 +376,23 @@
> >>  .*Warning: invalid CSR `hstateen3h', needs rv32i extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `h' extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: read-only CSR is written `csrw stopi,a1'
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: read-only CSR is written `csrw scountovf,a1'
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.d b/gas/testsuite/gas/riscv/csr-version-1p9p1.d
> >> index a34b99f4632..24a277142fa 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p9p1.d
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.d
> >> @@ -601,6 +601,28 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+24459073[     ]+csrw[         ]+vsip,a1
> >>  [      ]+[0-9a-f]+:[   ]+28002573[     ]+csrr[         ]+a0,vsatp
> >>  [      ]+[0-9a-f]+:[   ]+28059073[     ]+csrw[         ]+vsatp,a1
> >> +[      ]+[0-9a-f]+:[   ]+35002573[     ]+csrr[         ]+a0,miselect
> >> +[      ]+[0-9a-f]+:[   ]+35059073[     ]+csrw[         ]+miselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+35102573[     ]+csrr[         ]+a0,mireg
> >> +[      ]+[0-9a-f]+:[   ]+35159073[     ]+csrw[         ]+mireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+35c02573[     ]+csrr[         ]+a0,mtopei
> >> +[      ]+[0-9a-f]+:[   ]+35c59073[     ]+csrw[         ]+mtopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+fb002573[     ]+csrr[         ]+a0,mtopi
> >> +[      ]+[0-9a-f]+:[   ]+fb059073[     ]+csrw[         ]+mtopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+30802573[     ]+csrr[         ]+a0,mvien
> >> +[      ]+[0-9a-f]+:[   ]+30859073[     ]+csrw[         ]+mvien,a1
> >> +[      ]+[0-9a-f]+:[   ]+30902573[     ]+csrr[         ]+a0,mvip
> >> +[      ]+[0-9a-f]+:[   ]+30959073[     ]+csrw[         ]+mvip,a1
> >> +[      ]+[0-9a-f]+:[   ]+31302573[     ]+csrr[         ]+a0,midelegh
> >> +[      ]+[0-9a-f]+:[   ]+31359073[     ]+csrw[         ]+midelegh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31402573[     ]+csrr[         ]+a0,mieh
> >> +[      ]+[0-9a-f]+:[   ]+31459073[     ]+csrw[         ]+mieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31802573[     ]+csrr[         ]+a0,mvienh
> >> +[      ]+[0-9a-f]+:[   ]+31859073[     ]+csrw[         ]+mvienh,a1
> >> +[      ]+[0-9a-f]+:[   ]+31902573[     ]+csrr[         ]+a0,mviph
> >> +[      ]+[0-9a-f]+:[   ]+31959073[     ]+csrw[         ]+mviph,a1
> >> +[      ]+[0-9a-f]+:[   ]+35402573[     ]+csrr[         ]+a0,miph
> >> +[      ]+[0-9a-f]+:[   ]+35459073[     ]+csrw[         ]+miph,a1
> >>  [      ]+[0-9a-f]+:[   ]+30c02573[     ]+csrr[         ]+a0,mstateen0
> >>  [      ]+[0-9a-f]+:[   ]+30c59073[     ]+csrw[         ]+mstateen0,a1
> >>  [      ]+[0-9a-f]+:[   ]+30d02573[     ]+csrr[         ]+a0,mstateen1
> >> @@ -641,6 +663,18 @@ Disassembly of section .text:
> >>  [      ]+[0-9a-f]+:[   ]+61e59073[     ]+csrw[         ]+hstateen2h,a1
> >>  [      ]+[0-9a-f]+:[   ]+61f02573[     ]+csrr[         ]+a0,hstateen3h
> >>  [      ]+[0-9a-f]+:[   ]+61f59073[     ]+csrw[         ]+hstateen3h,a1
> >> +[      ]+[0-9a-f]+:[   ]+15002573[     ]+csrr[         ]+a0,siselect
> >> +[      ]+[0-9a-f]+:[   ]+15059073[     ]+csrw[         ]+siselect,a1
> >> +[      ]+[0-9a-f]+:[   ]+15102573[     ]+csrr[         ]+a0,sireg
> >> +[      ]+[0-9a-f]+:[   ]+15159073[     ]+csrw[         ]+sireg,a1
> >> +[      ]+[0-9a-f]+:[   ]+15c02573[     ]+csrr[         ]+a0,stopei
> >> +[      ]+[0-9a-f]+:[   ]+15c59073[     ]+csrw[         ]+stopei,a1
> >> +[      ]+[0-9a-f]+:[   ]+db002573[     ]+csrr[         ]+a0,stopi
> >> +[      ]+[0-9a-f]+:[   ]+db059073[     ]+csrw[         ]+stopi,a1
> >> +[      ]+[0-9a-f]+:[   ]+11402573[     ]+csrr[         ]+a0,sieh
> >> +[      ]+[0-9a-f]+:[   ]+11459073[     ]+csrw[         ]+sieh,a1
> >> +[      ]+[0-9a-f]+:[   ]+15402573[     ]+csrr[         ]+a0,siph
> >> +[      ]+[0-9a-f]+:[   ]+15459073[     ]+csrw[         ]+siph,a1
> >>  [      ]+[0-9a-f]+:[   ]+da002573[     ]+csrr[         ]+a0,scountovf
> >>  [      ]+[0-9a-f]+:[   ]+da059073[     ]+csrw[         ]+scountovf,a1
> >>  [      ]+[0-9a-f]+:[   ]+72302573[     ]+csrr[         ]+a0,mhpmevent3h
> >> diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.l b/gas/testsuite/gas/riscv/csr-version-1p9p1.l
> >> index 4fac40fb589..7d4e097a3e8 100644
> >> --- a/gas/testsuite/gas/riscv/csr-version-1p9p1.l
> >> +++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.l
> >> @@ -461,6 +461,39 @@
> >>  .*Warning: invalid CSR `vsip', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >>  .*Warning: invalid CSR `vsatp', needs `h' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `miselect', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mireg', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopei', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: invalid CSR `mtopi', needs `smaia' extension
> >> +.*Warning: read-only CSR is written `csrw mtopi,a1'
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvien', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvip', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `midelegh', needs rv32i extension
> >> +.*Warning: invalid CSR `midelegh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mieh', needs rv32i extension
> >> +.*Warning: invalid CSR `mieh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mvienh', needs rv32i extension
> >> +.*Warning: invalid CSR `mvienh', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `mviph', needs rv32i extension
> >> +.*Warning: invalid CSR `mviph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >> +.*Warning: invalid CSR `miph', needs rv32i extension
> >> +.*Warning: invalid CSR `miph', needs `smaia' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen0', needs `smstateen' extension
> >>  .*Warning: invalid CSR `mstateen1', needs `smstateen' extension
> >> @@ -533,6 +566,23 @@
> >>  .*Warning: invalid CSR `hstateen3h', needs rv32i extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `h' extension
> >>  .*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siselect', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sireg', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopei', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: invalid CSR `stopi', needs `ssaia' extension
> >> +.*Warning: read-only CSR is written `csrw stopi,a1'
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `sieh', needs rv32i extension
> >> +.*Warning: invalid CSR `sieh', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >> +.*Warning: invalid CSR `siph', needs rv32i extension
> >> +.*Warning: invalid CSR `siph', needs `ssaia' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
> >>  .*Warning: read-only CSR is written `csrw scountovf,a1'
> >> diff --git a/gas/testsuite/gas/riscv/csr.s b/gas/testsuite/gas/riscv/csr.s
> >> index 128aeb83a04..bf37afa06e0 100644
> >> --- a/gas/testsuite/gas/riscv/csr.s
> >> +++ b/gas/testsuite/gas/riscv/csr.s
> >> @@ -337,6 +337,19 @@
> >>         csr vsip
> >>         csr vsatp
> >>
> >> +       # Smaia
> >> +       csr miselect
> >> +       csr mireg
> >> +       csr mtopei
> >> +       csr mtopi
> >> +       csr mvien
> >> +       csr mvip
> >> +       csr midelegh
> >> +       csr mieh
> >> +       csr mvienh
> >> +       csr mviph
> >> +       csr miph
> >> +
> >>         # Smstateen extension
> >>         csr mstateen0
> >>         csr mstateen1
> >> @@ -359,6 +372,14 @@
> >>         csr hstateen2h
> >>         csr hstateen3h
> >>
> >> +       # Ssaia
> >> +       csr siselect
> >> +       csr sireg
> >> +       csr stopei
> >> +       csr stopi
> >> +       csr sieh
> >> +       csr siph
> >> +
> >>         # Sscofpmf extension
> >>         csr scountovf
> >>         csr mhpmevent3h
> >> diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h
> >> index 88b8d7ff595..d56ab88696d 100644
> >> --- a/include/opcode/riscv-opc.h
> >> +++ b/include/opcode/riscv-opc.h
> >> @@ -2432,6 +2432,18 @@
> >>  #define CSR_UIP 0x44
> >>  #define CSR_SEDELEG 0x102
> >>  #define CSR_SIDELEG 0x103
> >> +/* Smaia extension */
> >> +#define CSR_MISELECT 0x350
> >> +#define CSR_MIREG    0x351
> >> +#define CSR_MTOPEI   0x35c
> >> +#define CSR_MTOPI    0xfb0
> >> +#define CSR_MVIEN    0x308
> >> +#define CSR_MVIP     0x309
> >> +#define CSR_MIDELEGH 0x313
> >> +#define CSR_MIEH     0x314
> >> +#define CSR_MVIENH   0x318
> >> +#define CSR_MVIPH    0x319
> >> +#define CSR_MIPH     0x354
> >>  /* Smstateen extension */
> >>  #define CSR_MSTATEEN0 0x30c
> >>  #define CSR_MSTATEEN1 0x30d
> >> @@ -2453,6 +2465,13 @@
> >>  #define CSR_HSTATEEN1H 0x61d
> >>  #define CSR_HSTATEEN2H 0x61e
> >>  #define CSR_HSTATEEN3H 0x61f
> >> +/* Ssaia extension */
> >> +#define CSR_SISELECT 0x150
> >> +#define CSR_SIREG    0x151
> >> +#define CSR_STOPEI   0x15c
> >> +#define CSR_STOPI    0xdb0
> >> +#define CSR_SIEH     0x114
> >> +#define CSR_SIPH     0x154
> >>  /* Sscofpmf extension */
> >>  #define CSR_SCOUNTOVF 0xda0
> >>  #define CSR_MHPMEVENT3H 0x723
> >> @@ -3154,6 +3173,18 @@ DECLARE_CSR(vscause, CSR_VSCAUSE, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_C
> >>  DECLARE_CSR(vstval, CSR_VSTVAL, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  DECLARE_CSR(vsip, CSR_VSIP, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  DECLARE_CSR(vsatp, CSR_VSATP, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +/* Smaia extension */
> >> +DECLARE_CSR(miselect, CSR_MISELECT, CSR_CLASS_SMAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mireg, CSR_MIREG, CSR_CLASS_SMAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mtopei, CSR_MTOPEI, CSR_CLASS_SMAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mtopi, CSR_MTOPI, CSR_CLASS_SMAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mvien, CSR_MVIEN, CSR_CLASS_SMAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mvip, CSR_MVIP, CSR_CLASS_SMAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(midelegh, CSR_MIDELEGH, CSR_CLASS_SMAIA_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mieh, CSR_MIEH, CSR_CLASS_SMAIA_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mvienh, CSR_MVIENH, CSR_CLASS_SMAIA_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(mviph, CSR_MVIPH, CSR_CLASS_SMAIA_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(miph, CSR_MIPH, CSR_CLASS_SMAIA_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  /* Smstateen extension */
> >>  DECLARE_CSR(mstateen0, CSR_MSTATEEN0, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  DECLARE_CSR(mstateen1, CSR_MSTATEEN1, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> @@ -3175,6 +3206,13 @@ DECLARE_CSR(hstateen0h, CSR_HSTATEEN0H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_
> >>  DECLARE_CSR(hstateen1h, CSR_HSTATEEN1H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  DECLARE_CSR(hstateen2h, CSR_HSTATEEN2H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  DECLARE_CSR(hstateen3h, CSR_HSTATEEN3H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +/* Ssstateen extension */
> >> +DECLARE_CSR(siselect, CSR_SISELECT, CSR_CLASS_SSAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(sireg, CSR_SIREG, CSR_CLASS_SSAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(stopei, CSR_STOPEI, CSR_CLASS_SSAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(stopi, CSR_STOPI, CSR_CLASS_SSAIA, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(sieh, CSR_SIEH, CSR_CLASS_SSAIA_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> +DECLARE_CSR(siph, CSR_SIPH, CSR_CLASS_SSAIA_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  /* Sscofpmf extension */
> >>  DECLARE_CSR(scountovf, CSR_SCOUNTOVF, CSR_CLASS_SSCOFPMF, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >>  DECLARE_CSR(mhpmevent3h, CSR_MHPMEVENT3H, CSR_CLASS_SSCOFPMF_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
> >> --
> >> 2.37.2
> >>


More information about the Binutils mailing list