The RISC-V instruction set architecture (ISA) includes a base specification and a variety of optional extensions. Below is a list of the specified extensions, categorized into primary extensions (single-letter) and standard Z extensions (with examples):
Primary Extensions (Single-Letter)
These are the most commonly referenced extensions beyond the base ISA (RV32I/RV64I):
-
M (Integer Multiply/Divide)
- Adds instructions for multiplication, division, and remainder operations on integers.
-
A (Atomic Instructions)
- Provides atomic read-modify-write operations for concurrent programming.
-
F (Single-Precision Floating-Point)
- Supports IEEE 754 single-precision floating-point operations.
-
D (Double-Precision Floating-Point)
- Extends F to support IEEE 754 double-precision floating-point operations.
-
Q (Quadruple-Precision Floating-Point)
- Adds IEEE 754 quadruple-precision (128-bit) floating-point operations (less commonly implemented).
-
C (Compressed Instructions)
- Reduces code size using 16-bit encodings for common operations, critical for embedded systems.
-
B (Bit Manipulation)
- Enhances bitwise operations (e.g., counting leading zeros, bit permute). Includes subsets like Zbb (base), Zba (atomic), Zbc (compressed), and Zbr (reduced).
-
V (Vector)
- Implements the RISC-V Vector Extension (RVV) for SIMD operations, configurable with parameters like vector length and data types.
Z Extensions (Standard Optional Extensions)
These are additional standardized extensions with specific purposes, prefixed with "Z" (for "zero" extensions, as they do not overlap with the base ISA):
Control & Status Registers (CSRs):
- Zicsr: Instructions to read/write control and status registers (e.g.,
csrrw, csrrs).
- Zifencei: Adds
fence.i for memory ordering in multi-core systems.
Floating-Point Enhancements:
- Zfh: Floating-point hard-float ABI conventions.
- Zfinx: Minimal floating-point subset for RV32 (e.g., used in small embedded systems).
Bit Manipulation Subsets (part of B extension):
- Zbb: Base bitmanip instructions (e.g.,
clz, ctz).
- Zba: Atomic bitmanip operations (e.g.,
bitrev).
- Zbc: Compressed encodings for bitmanip instructions.
- Zbr: Reduced bitmanip subset for minimal implementations.
Debug & Performance:
- Zicntr: Cycle counter CSR (
mcycle for performance monitoring).
- Zihintpause:
hint.pause instruction for power-saving.
Memory & Cache:
- Zicbom: Cache maintenance operations (e.g.,
sfence.vma).
- Zicboz: Zero-initialized cache block operations.
- Zicma: General cache maintenance (e.g., invalidate, clean).
Knob Control:
- Zknd: Dynamic control of hardware features (e.g., vector length).
Other:
- Zmmul: Multiply-multiply instructions for complex arithmetic.
- Ztso: Total Store Order memory model (part of privileged architecture).
- Zca: Cache architecture control (e.g., invalidate all caches).
Notes:
- Hypervisor/Privileged Extensions:
Extensions like H (hypervisor) and S (supervisor) are part of the privileged architecture (not the ISA itself) and manage operating system and virtualization features.
- Custom Extensions:
The K extension is reserved for custom vendor-specific extensions.
- Vector Configuration:
The V extension requires configuration parameters (e.g., vector length, data types), making it highly flexible but complex.
For a complete list of Z extensions, refer to the RISC-V Specification, particularly the RISC-V Privileged Architecture and RISC-V Vector documents.