RV32I vs RV64GC: RISC-V Extension Letters Explained
Put an ESP32-C3 board next to a VisionFive 2 and both say RISC-V on the box. The first runs an RV32IMC core at up to 160 MHz. The second has four SiFive U74 cores, RV64GC, that boot Debian. A program compiled for the second will not run on the first, and a binary built for the first would make no sense to the second's operating system. Same instruction set family, very different machines, and the whole difference is written in those few letters after "RV".
This is the second of our RISC-V pillar guides. The first, RISC-V explained, covers what an open ISA is and how the 32-bit instruction formats work. Here we decode every letter, count what each one adds, and look at which letters real chips actually pick.
How do you read a RISC-V name like RV64GC?
The specification defines a naming convention, and once you know it, the strings stop looking like noise. There are four parts, shown in Figure 1.
- RV: the family, RISC-V.
- 32, 64 or 128: XLEN, the width of the integer registers and of addresses.
- A base: I for the full integer base with 32 registers, or E for the embedded base with 16.
- Extensions: single letters in a canonical order, then longer names that start with Z (standard) or X (vendor specific), joined by underscores.
So RV32IMC is a 32-bit core with the integer base, multiply and divide, and compressed instructions. RV64GC is a 64-bit core with G and C. Compilers use the same strings: GCC and Clang take -march=rv64gc or -march=rv32imac_zba_zbb and generate only instructions from those extensions.
RV32 vs RV64: what changes when the registers double?
XLEN is the width of every integer register, of the program counter and of addresses. On RV32 a pointer is 32 bits, so a program can address at most:
That is plenty for a microcontroller with 400 KB of SRAM and useless for a phone with 8 GB of RAM. RV64 registers are 64 bits, and a typical RV64 Linux system uses the Sv39 virtual memory scheme, which gives each process 39 bits of virtual address space:
The cost is silicon. Each of the 31 writable integer registers (x0 is fixed at zero) doubles in width, and so does every adder, shifter and bypass path in the datapath:
RV64I also adds 12 instructions to RV32I. Most of them are "W" versions, such as addw and sllw, that work on 32-bit values and sign-extend the result, because C code is full of 32-bit int arithmetic that must wrap at 32 bits even on a 64-bit machine. The rest are 64-bit loads and stores, ld, sd and lwu.
Myth: RV64 means 64-bit instructions
It does not. The 64 is about data and addresses. RV64 instructions are 32 bits long, exactly like RV32, and with the C extension many become 16 bits. Every instruction format from the first guide is unchanged; RV64 only widens one field, the shift amount in slli, srli and srai, from 5 bits to 6 so it can shift by up to 63. The same is true of x86-64 and of 64-bit Arm, where "64-bit" has never described the length of an instruction.
What does each RISC-V extension letter add?
I and E: the base
I is the integer base: 40 instructions in RV32I for arithmetic, logic, shifts, loads, stores, branches, jumps and the system calls. E is the same instruction set with half the registers, 16 instead of 32, for the smallest microcontrollers. The WCH CH32V003, a 48 MHz part with 16 KB of flash and 2 KB of SRAM that sells for small change, is RV32EC. Losing half the registers costs some speed because the compiler spills more to memory. The Hazard3 project measured about 5% lower CoreMark per MHz for its RV32E build.
M: multiply and divide
Without M, the compiler turns every a * b into a call to a shift-and-add routine in the C library. M adds eight instructions in RV32: mul, three variants of mulh for the upper half of the product, and signed and unsigned div and rem. Almost every real core has it. OnionSoC v2.2, for example, is RV32IM.
A: atomics
A adds load-reserved and store-conditional (lr.w, sc.w) plus nine atomic read-modify-write operations such as amoadd.w and amoswap.w. You need these the moment two cores, or a core and an interrupt handler, share data. An operating system with threads will not run without them, which is why A is in G.
F, D and Q: floating point
F adds 32 floating-point registers, a control and status register for rounding modes and exceptions, and 26 instructions for IEEE 754 single precision, including a fused multiply-add. D widens those registers to 64 bits and adds 26 double-precision instructions. Q, rarely implemented, goes to 128-bit quad precision. The F and D register file alone is a big block of state:
Most microcontrollers skip F and D entirely and do floating point in software, because a double-precision unit with its 64-bit register file can take more area than a small integer core.
Zicsr and Zifencei: the plumbing
These two used to be part of I and were split out in 2019. Zicsr is six instructions that read and write control and status registers: timers, interrupt enables, the floating-point flags. Zifencei is one instruction, fence.i, that makes sure the core fetches freshly written code, which matters to a JIT compiler or a bootloader that copies a program into RAM.
C: compressed instructions
C is different from the others. It adds no new operations. It gives the most common instructions a second, 16-bit encoding: register moves, small immediates, loads and stores relative to the stack pointer, short branches. The trade is fewer registers and smaller immediates in exchange for half the size. The specification says that typically 50 to 60% of the instructions in a program can be replaced, which is where the commonly quoted saving comes from. With a share of instructions halved in size:
That is code 25 to 30% smaller. Turn it around and the number gets bigger. A core without C runs code that is to times the size, so 33 to 43% more flash for the same program, not 25 to 30%. On a microcontroller with 16 KB of flash that difference decides what fits. It is why nearly every commercial RISC-V microcontroller includes C, and why compressed instructions are first on the list for the next OnionSoC core.
B: bit manipulation
B bundles three extensions ratified in 2021: Zba for address generation (shift-and-add, which speeds up array indexing), Zbb for basic bit operations (count leading zeros, population count, rotate, min and max, byte reverse) and Zbs for single-bit set, clear, invert and test. The single letter B was only defined as their shorthand in April 2024. Hazard3, inside the RP2350, implements all three plus several more Z extensions, and they are a large part of why its CoreMark per MHz is high for a three-stage pipeline.
V: vectors
V, ratified in late 2021 with version 1.0, adds 32 vector registers and instructions that process many elements at once. Unlike fixed-width SIMD, the vector length is not baked into the program. Code asks the hardware how many elements it can take this pass with vsetvli, so the same binary runs on a core with 128-bit vector registers and on one with 256-bit registers like the SpacemiT K1's X60 cores, just faster on the wider one. V is the extension behind most of the "AI" claims made for new RISC-V chips.
H, and everything that starts with Z or X
H adds hypervisor support for running virtual machines. Beyond that, the specification has a long tail of Z extensions (scalar crypto, cache management, half precision, more compressed forms such as Zcb and Zcmp), and vendors may add their own non-standard X extensions. Those are legal, but software that uses them will not run on anyone else's chip.
Which extensions do real RISC-V chips use?
Figure 4 lines up six parts. The pattern is clear. Microcontrollers pick exactly the letters they need, and C is nearly always one of them. Application processors that run Linux take the full G bundle plus C, and the newest add V and B.
Why profiles like RVA23 matter more than letters
Letters describe a core. They do not tell a software vendor what it can count on. If one Linux phone has V and the next does not, an app store has to ship two builds or use the lowest common denominator. RISC-V International's answer is profiles, fixed bundles of mandatory extensions for a class of machine. RVA20 roughly matched RV64GC. RVA22 added a set of Z extensions including the bit manipulation set. RVA23, ratified in October 2024, makes the vector and hypervisor extensions mandatory, and it is the baseline the industry is now aiming application processors at.
For a microcontroller, the letters are still the right language: you pick a part with M if you multiply, F if you need fast floating point, C if flash is tight. For anything that runs a general operating system, read the profile first and the letters second.
How to choose: a short guide
- Blink LEDs and read sensors on the cheapest part: RV32EC or RV32IMC. The CH32V003 and ESP32-C3 are typical.
- Real-time control with an RTOS and multicore: RV32IMAC, possibly with B for faster bit twiddling. The RP2350's Hazard3 is a good example.
- Signal processing with floats: add F (and D if your algorithms need double precision), or look for a DSP-oriented extension.
- Linux: RV64GC at minimum. For new designs aimed at standard distributions, RVA23.
- Learning or building your own core: start with RV32I, then add M, as OnionSoC did, and then C, which is where the decoder gets interesting.
Performance, power and licensing across the three big instruction sets are the subject of the next guide, RISC-V vs Arm vs x86.
fence, ecall and ebreak are counted as separate instructions; the 40 for RV32I matches the specification's own statement. The 25 to 30% saving for C is the specification's typical figure, and real programs vary around it.Frequently asked questions
What does RV64GC mean?
RV64GC is a RISC-V processor with 64-bit integer registers (RV64), the general-purpose bundle G, which is I, M, A, F and D plus Zicsr and Zifencei, and the C extension for 16-bit compressed instructions. It is the classic baseline that 64-bit Linux distributions for RISC-V were built for.
What does G stand for in RISC-V?
G means general purpose. It is shorthand for IMAFD plus Zicsr and Zifencei: the base integer set, multiply and divide, atomics, single and double precision floating point, control and status register instructions and the instruction fetch fence.
Does RV64 use 64-bit instructions?
No. The 64 refers to the width of the integer registers and addresses. RV64 instructions are still 32 bits long, or 16 bits with the C extension, exactly as on RV32.
What is the difference between RV32I and RV32E?
RV32E has the same instructions as RV32I but only 16 integer registers instead of 32, which roughly halves the register file for very small microcontrollers such as the WCH CH32V003.
How much smaller does the C extension make RISC-V code?
The RISC-V specification says 50 to 60 percent of instructions in typical programs can use 16-bit compressed forms, which makes code 25 to 30 percent smaller. Put the other way, a core without C needs 33 to 43 percent more memory for the same program.
Related on The Science 360
Sources
- RISC-V Unprivileged ISA, RV32I chapter (40 instructions), RV64I, M, A, F, D, Zicsr, Zifencei and naming conventions: docs.riscv.org
- "C" extension for compressed instructions, version 2.0 (50 to 60% of instructions, 25 to 30% smaller code): docs.riscv.org
- B extension (Zba, Zbb, Zbs), ratified April 2024: RISC-V unified database
- RISC-V International ratifies 15 new specifications including Vector 1.0 (December 2021): HPCwire
- RVA23 profile ratification (vector and hypervisor mandatory): riscv.org
- ESP32-C3, 32-bit RISC-V core up to 160 MHz: espressif.com
- WCH CH32V003, QingKe RV32EC core at 48 MHz: wch-ic.com
- StarFive JH7110, four RV64GC U74 cores: doc-en.rvspace.org
- SpacemiT K1 / X60 (RV64GCVB, RVA22, 256-bit RVV 1.0): Banana Pi BPI-F3 documentation
- Hazard3 (extensions, RV32E CoreMark penalty): github.com/Wren6991/Hazard3
- RP2350 Hazard3 configuration in LLVM: LLVM commit
- OnionSoC v2.2 (RV32IM): github.com/oniondas/onion-soc
Header image: OnionSoC Sky130 chip layout, from github.com/oniondas/onion-soc, regraded for this article.