← Back to Blogs
HN Story

Understanding Floating-Point Support in RISC-V: From Scalar to Vector Extensions

May 20, 2026

Understanding Floating-Point Support in RISC-V: From Scalar to Vector Extensions

The RISC-V architecture is renowned for its modularity, allowing implementers to include only the features necessary for their specific target workload. This philosophy is nowhere more evident than in its approach to floating-point (FP) arithmetic. Unlike many monolithic ISAs, the RISC-V base ISA (RV32I or RV64I) contains no floating-point instructions; instead, it provides a rich ecosystem of extensions that can be layered depending on the precision and performance requirements of the application.

This modularity allows a developer to scale from a tiny embedded controller using soft-float libraries to a high-performance computing (HPC) or AI accelerator utilizing wide vector registers and specialized low-precision formats.

The Scalar Floating-Point Architecture

Dedicated vs. Unified Register Files

One of the most critical architectural decisions in RISC-V is the use of a dedicated Floating-Point Register File (FRF). The standard F extension introduces 32 registers of width FLEN.

This separation from the General Purpose Register file (XRF) offers several advantages:

  • Reduced Resource Competition: Floating-point operations do not compete with integer operations for the same architectural storage.
  • Flexible Sizing: The width of the general-purpose registers (XLEN) can differ from the floating-point registers (FLEN). For instance, an RV32 + D configuration uses 32-bit integer registers but 64-bit floating-point registers.
  • Simplified Allocation: Compilers can allocate registers more efficiently when the two data types are segregated.

However, this comes at a cost: it requires dedicated load/store instructions and data movement operations between the FRF and XRF.

The "In-X" Alternative: Zfinx

To mitigate the hardware overhead of an additional register file, RISC-V provides the Zfinx family of extensions. These allow floating-point operations to operate directly from the general-purpose registers (XRF).

  • Zfinx is the equivalent of the F extension (single precision).
  • Zdinx corresponds to the D extension (double precision).
  • Zhinx/Zhinxmin correspond to half-precision support.

By reusing the XRF, implementers remove the need for floating-point-specific loads and stores, though they lose the benefits of separate register pressure and flexible sizing.

Precision Levels and IEEE 754 Compliance

RISC-V primarily adheres to the IEEE 754-2008 standard, ensuring compatibility with the most widely accepted arithmetic standards for CPUs.

Standard Precision Extensions

  • F (Single Precision): Supports binary32 (FP32). This is the baseline for most other FP extensions.
  • D (Double Precision): Supports binary64.
  • Q (Quad Precision): Supports binary128, though adoption has been limited.
  • Zfh / Zfhmin (Half Precision): Supports binary16. Zfhmin is a minimal subset that allows binary16 to be used as a storage format, promoting values to binary32 for actual computation to save hardware area.

Enhanced Functionality: Zfa

The Zfa extension adds utility operations to the standard formats, including floating-point load immediates (providing 32 useful constants), quiet comparisons, and various rounding-to-integer operations.

Vector Floating-Point and AI Acceleration

Baseline vector support is introduced via RVV 1.0, which provides vector variants for almost all scalar instructions. Notably, vector multiply-accumulate instructions are "destructive," meaning one operand is overwritten as the destination to optimize register usage.

The Shift Toward Low Precision

With the explosion of Machine Learning (ML), there is a growing demand for formats that prioritize throughput and energy efficiency over extreme precision.

  1. BFloat16 (BrainFloat16): A 16-bit format that truncates binary32. RISC-V supports this through Zfbfmin (scalar) and Zvfbfmin/Zvfbfwma (vector). A more comprehensive extension, Zvfbfa, is currently in development to provide nearly full vector support for BFloat16.
  2. OFP8 and OFP4: To further reduce memory bandwidth, RISC-V is exploring Open Compute’s 8-bit (Zvfofp8min) and 4-bit (Zvfofp4min) floating-point formats.
  3. Micro-scaling (MX): Based on the OpenCompute MX scaling format, this approach stores a block of values with a shared scaling factor, significantly reducing the total bits required to represent a tensor of values.

Future Outlook and Challenges

As RISC-V expands, it faces the challenge of competing standards. While the Open Compute Project (OCP) provides a small set of focused formats, the IEEE P3109 effort is creating a broad framework for hundreds of possible small formats. RISC-V will likely need to define specific profiles to prevent ecosystem fragmentation.

Community Perspectives

The complexity of the RISC-V extension naming convention and the sheer volume of options can be daunting. As one community member noted:

"From a bystanderʼs POV it is excessively hard to memorize all the mess with multiple different extensions. The naming style doesnʼt alleviate the task."

Furthermore, there is ongoing discussion regarding alternatives to IEEE 754 entirely, such as Posits, which aim to solve fundamental flaws in floating-point representation, though IEEE compatibility remains the immediate priority for the industry.

Summary of Key Extensions

Extension Purpose Register File
F Single Precision (FP32) Dedicated (FRF)
D Double Precision (FP64) Dedicated (FRF)
Zfinx Single Precision (FP32) General Purpose (XRF)
Zfh Half Precision (FP16) Dedicated (FRF)
Zvfbfmin BFloat16 (Vector) Vector Registers
Zve32f Vector Single Precision Vector Registers

References

HN Stories