[Paper Review] The Renewed Case for the Reduced Instruction Set Computer: Avoiding ISA Bloat with Macro-Op Fusion for RISC-V
This paper argues that RISC-V can achieve performance and code density comparable to CISC ISAs like x86-64 through macro-op fusion, a technique that combines common instruction sequences into single internal operations without extending the ISA. By fusing frequently occurring idioms such as compare-and-branch, RISC-V reduces effective instruction count by 5.4% and achieves 8% fewer dynamic instruction bytes than x86-64 when combined with the compressed instruction set, proving that a minimal, open ISA can outperform complex ISAs through microarchitectural innovation rather than instruction set bloat.
This report makes the case that a well-designed Reduced Instruction Set Computer (RISC) can match, and even exceed, the performance and code density of existing commercial Complex Instruction Set Computers (CISC) while maintaining the simplicity and cost-effectiveness that underpins the original RISC goals. We begin by comparing the dynamic instruction counts and dynamic instruction bytes fetched for the popular proprietary ARMv7, ARMv8, IA-32, and x86-64 Instruction Set Architectures (ISAs) against the free and open RISC-V RV64G and RV64GC ISAs when running the SPEC CINT2006 benchmark suite. RISC-V was designed as a very small ISA to support a wide range of implementations, and has a less mature compiler toolchain. However, we observe that on SPEC CINT2006 RV64G executes on average 16% more instructions than x86-64, 3% more instructions than IA-32, 9% more instructions than ARMv8, but 4% fewer instructions than ARMv7. CISC x86 implementations break up complex instructions into smaller internal RISC-like micro-ops, and the RV64G instruction count is within 2% of the x86-64 retired micro-op count. RV64GC, the compressed variant of RV64G, is the densest ISA studied, fetching 8% fewer dynamic instruction bytes than x86-64. We observed that much of the increased RISC-V instruction count is due to a small set of common multi-instruction idioms. Exploiting this fact, the RV64G and RV64GC effective instruction count can be reduced by 5.4% on average by leveraging macro-op fusion. Combining the compressed RISC-V ISA extension with macro-op fusion provides both the densest ISA and the fewest dynamic operations retired per program, reducing the motivation to add more instructions to the ISA. This approach retains a single simple ISA suitable for both low-end and high-end implementations, where high-end implementations can boost performance through microarchitectural techniques.
Motivation & Objective
- To evaluate whether a minimal, open RISC-V ISA can match or exceed the performance and code density of commercial CISC ISAs like x86-64 and ARM.
- To investigate whether macro-op fusion can reduce the effective instruction count in RISC-V without extending the ISA, thereby avoiding ISA bloat.
- To demonstrate that microarchitectural techniques like macro-op fusion can compensate for the higher dynamic instruction count observed in RISC-V compared to CISC ISAs.
- To show that combining macro-op fusion with the RISC-V compressed instruction set (RV64GC) yields the densest instruction fetch performance among all ISAs studied.
- To advocate for a single, simple, extensible ISA that supports both low-end and high-end processors through microarchitectural optimizations rather than ISA complexity.
Proposed method
- The authors compare dynamic instruction counts and instruction bytes fetched across six ISAs—ARMv7, ARMv8, IA-32, x86-64, RV64G, and RV64GC—using the SPEC CINT2006 benchmark suite.
- They identify common instruction idioms, such as compare-and-branch sequences, that contribute to higher RISC-V instruction counts and are prime candidates for macro-op fusion.
- The paper proposes leveraging existing compiler hooks in GCC, specifically TARGET_SCHED_MACRO_FUSION_PAIR_P, to detect and fuse compatible instruction pairs during code generation.
- A modified register allocation strategy is applied to enable aggressive register reuse, increasing the number of fusable instruction pairs.
- The effectiveness of macro-op fusion is evaluated by measuring reductions in effective instruction count and dynamic instruction bytes relative to x86-64 micro-op counts.
- The study combines the RISC-V Compressed ISA (RV64GC) with macro-op fusion to assess cumulative benefits on code density and execution efficiency.
Experimental results
Research questions
- RQ1Can macro-op fusion reduce the effective instruction count in RISC-V to levels competitive with CISC ISAs like x86-64?
- RQ2To what extent does the RISC-V Compressed ISA (RV64GC) improve code density compared to x86-64 and other ISAs?
- RQ3How much performance improvement can be achieved through macro-op fusion without extending the RISC-V ISA?
- RQ4What is the impact of compiler-aware macro-op fusion on the number of fusable instruction pairs in RISC-V code?
- RQ5Can a single, minimal RISC-V ISA support both low-end and high-end processors through microarchitectural optimizations rather than ISA extensions?
Key findings
- RV64G executes 16% more instructions than x86-64 and 23% more instruction bytes, but its instruction count is within 2% of x86-64’s retired micro-op count.
- RV64GC, the compressed variant of RISC-V, fetches 8% fewer dynamic instruction bytes than x86-64, making it the densest ISA in the study.
- Macro-op fusion reduces the effective instruction count in RISC-V by 5.4% on average, bringing it to 4.2% fewer effective instructions than x86-64’s micro-op count.
- The study identifies that over half of the potential macro-op fusion opportunities are currently missed due to compiler limitations, indicating significant untapped performance gains.
- The combination of macro-op fusion and the RISC-V Compressed ISA enables a single, simple ISA to achieve both high performance and high code density without ISA bloat.
- The results show that microarchitectural techniques like macro-op fusion can compensate for the higher dynamic instruction count in RISC-V, making it competitive with CISC ISAs without requiring ISA extensions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.