-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dialects: add all rv32i/rv64i CSR instructions (#852)
This PR adds all the instructions in the RV32I/RV64I Section 2.8 (Control and Status Register Instructions) of the spec. WIP: this section of the spec defines instructions with weird behavior, like: > Atomically swaps values in the CSRs and integer registers. CSRRW reads the old value of the CSR, zero-extends the value to XLEN bits, then writes it to integer register rd. The initial value in rs1 is written to the CSR. The initial value in rs1 is written to the CSR. **If rd=x0, then the instruction shall not read the CSR and shall not cause any of the side-effects that might occur on a CSR read.** In order to expose this *full* (e.g.: *read/write*) VS *limited* (e.g.: *write only*) behavior the idea is to treat instructions like regular ones by taking into account their *full* behaviour and then use an attribute to switch on the *limited* mode. When, for example, we have a `riscv.csrrw` in *limited mode*, rd **must be allocated to x0**. --------- Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
- Loading branch information
1 parent
dd178f3
commit 8e051e5
Showing
3 changed files
with
398 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.