GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
risc-v

RISC-V: Add C API and hwprobe bit for the zicfiss extension.

Adds metadata and runtime feature-bit probing for the RISC-V zicfiss extension, aligning with the C API and Linux hwprobe.

This commit adds metadata and runtime feature-bit probing for the RISC-V zicfiss extension. It incorporates the RISC-V C API feature bit as defined in riscv-c-api-doc PR #187 and maps it to the corresponding Linux hwprobe constant (RISCV_HWPROBE_KEY_IMA_EXT_1). This allows the compiler to detect the zicfiss extension at runtime, improving compatibility and feature detection. The patch does not include new ISA extension support.

In Details

The RISC-V C API uses feature bits to indicate the presence of extensions. This patch adds the feature bit for zicfiss (scalar isfinite instruction set extension) and connects it to the Linux kernel's hardware probing interface. The feature_bits.c file in libgcc is updated to query the IMA_EXT_1 hwprobe and set the zicfiss feature bit accordingly. This commit ensures that GCC can accurately detect the zicfiss extension at runtime, which is essential for code generation and optimization.

For Context

RISC-V uses extensions to add optional features to the base instruction set. Compilers need to know which extensions are present to generate efficient code. This commit adds support for detecting the 'zicfiss' extension, which provides scalar isfinite instructions. It updates the compiler's internal metadata and adds code to query the Linux kernel to determine if the hardware supports this extension. This allows the compiler to take advantage of the 'zicfiss' extension when available, potentially improving performance.

Filed Under: risc-vzicfissfeature detectionhwprobe