diff --git a/libc/src/__support/macros/properties/cpu_features.h b/libc/src/__support/macros/properties/cpu_features.h index 3677e1fc3275c..457a2b7869d40 100644 --- a/libc/src/__support/macros/properties/cpu_features.h +++ b/libc/src/__support/macros/properties/cpu_features.h @@ -61,15 +61,15 @@ #if defined(__riscv_flen) // https://github.com/riscv-non-isa/riscv-c-api-doc/blob/main/src/c-api.adoc -#if (__riscv_flen & 0x10) +#if (__riscv_arch_test && __riscv_zfhmin) #define LIBC_TARGET_CPU_HAS_RISCV_FPU_HALF #define LIBC_TARGET_CPU_HAS_FPU_HALF #endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_HALF -#if (__riscv_flen & 0x20) +#if (__riscv_flen >= 32) #define LIBC_TARGET_CPU_HAS_RISCV_FPU_FLOAT #define LIBC_TARGET_CPU_HAS_FPU_FLOAT #endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_FLOAT -#if (__riscv_flen & 0x40) +#if (__riscv_flen >= 64) #define LIBC_TARGET_CPU_HAS_RISCV_FPU_DOUBLE #define LIBC_TARGET_CPU_HAS_FPU_DOUBLE #endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_DOUBLE