What I Learned About RISC-V: Why Small Bases Beat Bloated Instruction Sets
Why legacy instruction sets never stop swelling, how RISC-V separates a tiny frozen base from modular extensions, and why open silicon belongs to the future.
Every processor speaks a low-level grammar etched into silicon: its Instruction Set Architecture (ISA), the boundary between what a compiler emits and what wires actually execute.
For half a century, mainstream computing operated as if that grammar could only expand. Once millions of compiled binaries assume an instruction exists, nobody wants to break backwards compatibility by deleting it. So decades pass, teams bolt on vector lanes, virtualization hooks, cryptographic instructions, and quirks left over from hardware built in the 1970s, until modern x86 manuals run past five thousand pages and fetching an opcode can take anywhere from one byte to fifteen just to locate where the next instruction starts.
What hooked me about RISC-V — started at UC Berkeley in 2010, the fifth Reduced Instruction Set Computing lineage after Patterson and Hennessy's early MIPS/RISC work — is how cleanly it rejects that ratchet. Instead of letting one giant monolith absorb every new workload forever, RISC-V freezes a tiny base integer set and treats everything else as composable extensions.
Why instruction sets keep swelling
Software backwards compatibility works like a one-way valve. Once a new opcode ships in commercial hardware:
- Compilers, OS kernels, and handwritten assembly intrinsics hardcode its exact flag side effects and corner behavior.
- Twenty years later, removing it would snap legacy binaries, so architects carry it forward in microcode or decoder tables forever.
- Emerging workloads (media codecs, encryption, matrix multiplication) need specialized throughput that scalar ALU instructions can't reach, piling yet another instruction family beside the museum of older ones.
Over enough CPU generations, decoder logic starts paying a tax on every fetch cycle — scanning variable-length instruction boundaries, cracking complex legacy ops into micro-ops, and verifying obscure flag combinations even when modern binaries rarely touch half the encoding space. Keeping an ISA small isn't minimalist aesthetics; it directly shrinks decode area, front-end power, and verification bugs.
A frozen trunk and modular letters
RISC-V splits the contract into a small permanent integer base (RV32I or RV64I, roughly 47 instructions) plus single-letter optional extensions:
graph LR
Base["RV32I / RV64I Base<br/>~47 Integer Ops · Frozen"] --> M["M · Mul/Div"]
Base --> A["A · Atomics"]
Base --> FD["F / D · Float"]
Base --> C["C · 16-bit Compressed"]
Base --> V["V · Vector Engine"]
Base --> X["X* · Custom NPU / Domain Ops"]
A tiny IoT controller inside an appliance can implement RV32EC — a 16-register integer core plus 16-bit compressed instructions to pack firmware tightly into flash — while a Linux workstation runs RV64GC (G being shorthand for the general Unix combination IMAFD + Zicsr + Zifencei). Both chips share the exact same stable base compiler target, yet neither wastes die area on silicon features it doesn't use:
| Extension | What it adds | Why separating it helps |
|---|---|---|
I (Base Integer) |
Loads, stores, branches, integer ALU (~47 ops) | Frozen permanently; simple soft cores can be written quickly |
M |
Integer multiply & divide | Tiny sensors skip multiplier arrays to save area and leakage |
A |
Atomic read-modify-write ops | Needed for Linux SMP locks; unnecessary on single-thread MCUs |
F / D |
IEEE 754 32-bit / 64-bit floating point | Omitted in integer controllers, enabled in workstations |
C |
16-bit compressed encodings | Shrinks code size ~25–30% without running a separate mode |
V |
Scalable vector processing (RVV) | Single vector loop scales cleanly across lane widths |
X... |
Reserved non-standard opcode space | Lets teams add domain accelerators alongside standard toolchains |
That last row changes how hardware-software co-design works. Instead of smuggling accelerator commands over slow MMIO buses or begging an ISA vendor for permission, teams can drop specialized matrix tiles or streaming primitives into reserved custom-0..custom-3 opcode slots right next to mainline GCC and LLVM codegen.
Symmetry down to the bitfields
Opening the unprivileged RISC-V spec after staring at older encodings is oddly refreshing. All base 32-bit instructions fit into six uniform formats (R, I, S, B, U, J), and notice where the register specifiers sit across them: rd occupies bits 11:7, rs1 always sits in 19:15, and rs2 always sits in 24:20. And register x0 is hardwired to constant zero — giving you NOP (addi x0, x0, 0) and MV (add rd, rs1, x0) with zero dedicated opcodes.
Locking rs1 and rs2 to invariant bit positions buys an immediate hardware win: the register file can begin fetching source operands in parallel with opcode decoding, before control logic has finished figuring out whether the instruction is an addition, a subtraction, or a conditional branch:
def decode_rv32i_fields(word: int) -> dict[str, int | str]:
"""Extract invariant bitfields of any 32-bit RISC-V instruction."""
opcode = word & 0x7F
rd = (word >> 7) & 0x1F # bits 11:7
funct3 = (word >> 12) & 0x07
rs1 = (word >> 15) & 0x1F # bits 19:15
rs2 = (word >> 20) & 0x1F # bits 24:20
funct7 = (word >> 25) & 0x7F
return {
"opcode": f"0b{opcode:07b}",
"rd": f"x{rd}",
"rs1": f"x{rs1}",
"rs2": f"x{rs2}",
"funct3": funct3,
"funct7": f"0x{funct7:02x}",
}
# add x3, x1, x2 -> 0x002081B3
assert decode_rv32i_fields(0x002081B3)["rs1"] == "x1"Even compressed 16-bit instructions (C) avoid turning the processor into a dual-mode state machine like classic ARM/Thumb: every 16-bit compressed encoding expands statelessly 1-to-1 into an equivalent 32-bit base instruction right at fetch. The execution core behind fetch stays uniform and still enjoys smaller instruction caches.
Vector code that stops aging out every hardware generation
Traditionally, widening vector registers meant printing another phonebook of instructions: MMX to SSE to SSE2 to AVX to AVX2 to AVX-512, forcing libraries to recompile or hand-tune dispatch paths whenever register bits doubled.
RISC-V's Vector extension (RVV) breaks that cycle with vector-length agnostic loops. Instead of hardcoding a 128-bit or 512-bit chunk size into the instruction name, software asks the hardware how many elements can be stripped per pass using vsetvl:
Given the remaining work AVL, silicon picks vl up to its native vector capacity VLMAX and advances pointers accordingly. The same compiled binary runs smoothly on an embedded DSP core with narrow vector lanes and on a wide datacenter accelerator without waiting for new opcodes.
It also helps to be clear about what RISC-V actually is: an open standard, not a mandate that every chip implementing it be open-source hardware. Vendors can still ship proprietary out-of-order cores while universities and students study open RTL implementations like Rocket, BOOM, or XiangShan without paying multi-million-dollar architectural licensing fees first.
Studying how clean that architecture stays when history isn't piled unconditionally onto every decoder makes it easy to see why momentum keeps building. As general CMOS scaling slows down and hardware specialization becomes unavoidable, letting small teams customize silicon safely on top of an open, inspectable grammar pulls architecture back out of proprietary vaults and puts real machine design within reach of ordinary labs and classrooms.