Skip to content

Commit 218e300

Browse files
Fix feature check for riscv
Signed-off-by: Mikhail R. Gadelha <[email protected]>
1 parent b7be878 commit 218e300

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libc/src/__support/macros/properties/cpu_features.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@
6161

6262
#if defined(__riscv_flen)
6363
// https://github.com/riscv-non-isa/riscv-c-api-doc/blob/main/src/c-api.adoc
64-
#if (__riscv_flen & 0x10)
64+
#if (__riscv_arch_test && __riscv_zfhmin)
6565
#define LIBC_TARGET_CPU_HAS_RISCV_FPU_HALF
6666
#define LIBC_TARGET_CPU_HAS_FPU_HALF
6767
#endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_HALF
68-
#if (__riscv_flen & 0x20)
68+
#if (__riscv_flen >= 32)
6969
#define LIBC_TARGET_CPU_HAS_RISCV_FPU_FLOAT
7070
#define LIBC_TARGET_CPU_HAS_FPU_FLOAT
7171
#endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_FLOAT
72-
#if (__riscv_flen & 0x40)
72+
#if (__riscv_flen >= 64)
7373
#define LIBC_TARGET_CPU_HAS_RISCV_FPU_DOUBLE
7474
#define LIBC_TARGET_CPU_HAS_FPU_DOUBLE
7575
#endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_DOUBLE

0 commit comments

Comments
 (0)