[RFC 0/4] riscv/binutils support Hypervisor Extension

Vineet Gupta vineetg@rivosinc.com
Thu Dec 16 17:33:24 GMT 2021


Hi,

This patchset adds support for Hypervisor Extension ratified recently
[1].

This is an RFC as I seek some guidance. The core changes to add new
instructions and CSRs are strightfwd however some of the peripheral
changes require some consensus:

1. single letter 'h' prefix in arch string (vs. existing multi-letter)
   This started because I couldn't coax the existing gcc driver to
   take a multi-letter h prefix. And while that was the initial motivation,
   following other discussion [2] it seems to make sense anyways.

2. I don't know how to generate the testsuite output files (.d) for the
   new files I added - does it start with copy/paste or does tooling
   exist to generate those.

Please review/comment !

Thx,
-Vineet

[1] https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions
[2] https://github.com/riscv/riscv-isa-manual/issues/781#issuecomment-983233088

Vineet Gupta (4):
  RISC-V: Hypervisor ext: Treat as "Standard" extension
  RISC-V: Hypervisor ext: CSR and Instructions
  RISC-V: Hypervisor ext: tests for new isns/csr and cleanup old csrs
  RISC-V: fix a comment for adding CSR entry and annotate switch-break

 bfd/elfxx-riscv.c                             |   5 +
 gas/config/tc-riscv.c                         |  15 ++-
 gas/testsuite/gas/riscv/csr-dw-regnums.d      |  10 --
 gas/testsuite/gas/riscv/csr-dw-regnums.s      |  10 --
 gas/testsuite/gas/riscv/h-ext-32.s            |  61 +++++++++
 gas/testsuite/gas/riscv/h-ext-64.s            |  68 ++++++++++
 .../gas/riscv/march-fail-single-prefix-h.d    |   3 -
 .../gas/riscv/march-fail-single-prefix.l      |   2 +-
 .../gas/riscv/priv-reg-fail-read-only-01.s    |  10 --
 .../gas/riscv/priv-reg-fail-version-1p10.l    |  10 --
 .../gas/riscv/priv-reg-fail-version-1p11.l    |  10 --
 .../gas/riscv/priv-reg-version-1p10.d         |  10 --
 .../gas/riscv/priv-reg-version-1p11.d         |  10 --
 .../gas/riscv/priv-reg-version-1p9p1.d        |  10 --
 gas/testsuite/gas/riscv/priv-reg.s            |  10 --
 include/opcode/riscv-opc.h                    | 123 ++++++++++++++----
 include/opcode/riscv.h                        |   1 +
 opcodes/riscv-opc.c                           |  23 +++-
 18 files changed, 264 insertions(+), 127 deletions(-)
 create mode 100644 gas/testsuite/gas/riscv/h-ext-32.s
 create mode 100644 gas/testsuite/gas/riscv/h-ext-64.s
 delete mode 100644 gas/testsuite/gas/riscv/march-fail-single-prefix-h.d

-- 
2.30.2



More information about the Binutils mailing list