GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/riscv-vector

RISC-V: Track altfmt in RVV vtype state

GCC now tracks the new `altfmt` field in RISC-V Vector `vtype` state, crucial for FP8 format selection in Zvfofp8min instructions.

GCC’s RISC-V backend now tracks the altfmt field within the RVV vtype state, which is vital for correctly handling Zvfofp8min instructions that use this field to select alternate FP8 formats. By integrating altfmt into vsetvl_info and the vsetvl pass, the compiler prevents merging or removing vector configurations that require distinct altfmt values. This ensures that vector operations, particularly those involving FP8, maintain correct functionality and efficiency.

In Details

The RISC-V Vector (RVV) extension (riscv-v.cc, riscv-vsetvl.cc, vector.md) provides highly configurable vector processing capabilities, managed by the vtype control status register and the vsetvl instruction. The vsetvl pass in GCC is crucial for optimizing vector loop configurations. This commit introduces the concept of altfmt (alternate format) to track the specific FP8 data format used by Zvfofp8min instructions. By adding altfmt to the vsetvl_info structure and enhancing the demand_system logic with DEMAND_ALTFMT_P in riscv-vsetvl.cc, the compiler can now correctl…

For Context

Modern computer processors, including RISC-V, often have special hardware units called 'vector units' that can perform the same operation on many pieces of data at once, greatly speeding up certain tasks like scientific calculations or graphics processing. To use these vector units effectively, programmers need to configure them using special instructions like vsetvl. This configuration involves setting a 'vector type' (vtype) that tells the hardware what kind of data it will be working with. This change in GCC's RISC-V compiler is about adding support for a new detail within this vtype configuration called altfmt. This altfmt field is specifically used by newer RISC-V instructions (Zvfofp8min) to choose between different ways of representing 'FP8' (8-bit floating-point) numbers. By having the compiler track this altfmt value, it can ensure that when vsetvl instructions are used, the vector unit is always set up correctly for the specific FP8 format required, preventing…

Filed Under: risc-vvectorizationfp8isa-extension