RISC-V
- is a free and open RISC Instruction Set Architecture
- started by graduate students in May 2010
RISC-V Landscape
See: https://landscape.riscv.org
RISC-V Bases
- RV32I - Base Integer Instruction Set, 32-bit
- RV32E - Base Integer Instruction Set (embedded), 32-bit, 16 registers with a smaller instruction set
- RV64I - Base Integer Instruction Set, 64-bit
- RV128 - Base Integer InstructionSet, 128-bit
RISC-V Extensions
Once we have the base we can add extensions to it to define the exact features of the core:
- M – Standard Extension for Integer Multiplication and Division
- RV32M extension implements 8 instructions
- RV64M adds 5 instructions to those 8
- A – Standard Extension for Atomic Memory Instructions
- F – Standard Extension for Single-Precision Floating-Point
- D – Standard Extension for Double-Precision Floating-Point
- double-precision floating-point registers
f0tof31are now 64-bit wide
- double-precision floating-point registers
- G – Shorthand for the base and above extensions
- Q – Standard Extension for Quad-Precision Floating-Point, introducing 128-bit wide floating point registers
- L – Standard Extension for Decimal Floating-Point operations
- C – Standard Extension for Compressed Instructions
- B – Standard Extension for Bit Manipulation
- J – Standard Extension for Dynamically Translated Languages such as C#, Go, Haskell, Java, JavaScript, OCaml, PHP, Python, R, Ruby, Scala or WebAssembly
- T – Standard Extension for Transactional Memory
- P – Standard Extension for Packed-SIMD Instructions
- V – Standard Extension for Vector Operations
- N – Standard Extension for User-Level Interrupts
- H – Standard Extension for Hypervisor
- S – extension, for supervisor operation
- H – extension, for hypervisor operation
- Zicsr extension, for manipulating CSR registers
- Zifencei extension, for instruction memory synchronization
RISC-V Registers
|
Register |
ABI Name |
Description |
Saver |
|---|---|---|---|
|
x0 |
zero |
Hard-wired zero |
|
|
x1 |
ra |
Return address |
Caller |
|
x2 |
sp |
Stack pointer |
Callee |
|
x3 |
gp |
Global pointer |
|
|
x4 |
tp |
Thread pointer |
|
|
x5 |
t0 |
Temporary/alternate link register |
Caller |
|
x6-7 |
t1-2 |
Temporaries |
Caller |
|
x8 |
s0/fp |
Saved register/frame pointer |
Callee |
|
x9 |
s1 |
Saved register |
Callee |
|
x10-11 |
a0-1 |
Function arguments/return values |
Caller |
|
x12-17 |
a2-7 |
Function arguments |
Caller |
|
x18-27 |
s2-11 |
Saved registers |
Callee |
|
x28-31 |
t3-6 |
Temporaries |
Caller |