RISC-V: They Should Have Known Better
Dmitry.GR delivers a scorching critique of RISC-V, arguing that its foundational design flaws, rampant optionality, and "ridiculous" instruction encoding hobble its potential beyond basic microcontrollers. The piece meticulously details architectural missteps, sparking a heated Hacker News debate on the practical challenges of open ISA development versus established, often proprietary, alternatives. It provocatively questions whether an open specification alone can overcome fundamental engineering misjudgments.
The Lowdown
Dmitry.GR presents a comprehensive and highly critical analysis of the RISC-V instruction set architecture, aiming to debunk common misconceptions and highlight what he perceives as fundamental design flaws. He contends that RISC-V's aspiration to dominate all computing segments, from tiny microcontrollers to supercomputers, is unrealistic due to inherent architectural compromises. The author argues that RISC-V proponents, particularly from academic backgrounds, have ignored decades of ISA design lessons, leading to a specification rife with practical problems.
- "Everything for Everyone" Fallacy: RISC-V attempts to be optimal for all use cases, which is inherently impossible due to conflicting design requirements for high-end CPUs (focused on throughput) and microcontrollers (focused on interrupt latency and code density). The author predicts RISC-V will only dominate the "cheap-as-dirt single-use microcontroller" space, and even there, it's despite its ISA design. The bar is so low, it's an improvement over 8051. The article highlights that RISC-V is notably worse than Cortex-M0 for interrupt handling in microcontrollers, requiring significantly more cycles.
- Inefficient Encoding and Missing Features: The article heavily criticizes RISC-V's instruction encoding, particularly for compressed instructions and immediates, calling it "ridiculous" and a "jigsaw puzzle." It points out poor design choices like limited offset ranges for memory operations in compressed instructions and the absence of obvious, useful instructions like "test bit and branch" or comprehensive bitfield operations, which are common and trivial to implement in hardware in other architectures. The late addition of extensions like Zba (for array addressing) is also seen as a sign of initial oversight.
- Excessive Optionality and Fragmentation: A central criticism is the extreme optionality of core features (multiplication, division, user/supervisor modes, CSRs). This leads to severe fragmentation, making it nearly impossible to write portable software or guarantee feature availability. The
misaregister, intended for feature detection, is itself optional and unreliable, and the architecture struggles with basic tasks like detecting the current CPU mode. The introduction of "profiles" like RVA23 to standardize optional extensions is deemed a belated, committee-driven fix that further fragments the ecosystem, as much existing "RISC-V" hardware is not RVA23 compliant. - Academic Roots and Future Outlook: The author attributes these design choices to a "not invented here" syndrome prevalent in academia, where real-world practicality was overlooked in favor of a clean-slate approach. Despite these flaws, the author acknowledges RISC-V's inevitable success in cost-sensitive markets (cheap microcontrollers, ML accelerators) due to its royalty-free nature. However, he maintains it is ill-suited for high-performance desktop or server markets, where better-designed, albeit proprietary, architectures like Aarch64 will continue to dominate. He argues RISC-V's market gains will be due to being "cheap," not "good."
In conclusion, Dmitry.GR paints a picture of RISC-V as an academically interesting but fundamentally flawed ISA, whose open nature may secure it niches in the market but whose design decisions prevent it from becoming a top-tier general-purpose computing platform. The article's detailed technical breakdowns serve as a cautionary tale against design-by-committee and the neglect of practical engineering wisdom.
The Gossip
Openness Over Optimization
Many commenters acknowledge the technical flaws detailed in the article but strongly advocate for RISC-V due to its open, royalty-free nature. This "openness" is highlighted as critical for specific markets, geopolitical interests (e.g., China), and hobbyists, allowing for innovation and avoidance of proprietary licensing fees. The sentiment often expressed is that an open standard, even if technically imperfect, offers a superior foundation compared to closed alternatives, especially where cost and freedom from IP encumbrances are paramount.
Fragmentation Frustration
The article's critique of RISC-V's pervasive optionality and the resulting ecosystem fragmentation spurred considerable discussion. Commenters acknowledge the difficulty in writing portable software and the confusion arising from diverse hardware implementations. While "profiles" like RVA23 are introduced to standardize feature sets for specific use cases (like Linux), this solution is also seen as a double-edged sword, creating new tiers of compatibility issues and highlighting the initial misstep of excessive optionality.
Decoding Dilemmas: Encoding and Performance
The debate frequently turned to the technical specifics of RISC-V's instruction encoding and its impact on performance compared to ARM and x86. The convoluted immediate encoding and the inefficiencies of interrupt handling were supported by anecdotal evidence. Commenters discussed whether the benefits of compressed instructions for code density outweigh the complexity added to high-performance decoders, with varied opinions on whether RISC-V truly offers superior code density or decoding simplicity in practice.
Lessons Unlearned: The Academic Divide
A recurring sentiment is that RISC-V, originating from academia, failed to incorporate decades of lessons learned from previous ISA designs like MIPS, ARM, and x86. This "not invented here" or "design-by-committee" approach is seen as leading to avoidable flaws, such as the optionality dilemma and inefficient instruction sets. Commenters muse on how such obvious design principles were overlooked, leading to a technically imperfect standard, despite its open appeal.