llvm-project
37dc60a7 - [libc][math][RISCV] Re-enable _Float16 and _Complex _Float16 on Clang >= 20 (#248025)

Commit
2 days ago
[libc][math][RISCV] Re-enable _Float16 and _Complex _Float16 on Clang >= 20 (#248025) Enable `LIBC_TYPES_HAS_FLOAT16` and `LIBC_TYPES_HAS_CFLOAT16` on RISC-V gated behind Clang >= 20 or GCC >= 13 (pre-existing). llvm-libc disabled _Float16 and _Complex _Float16 on RISC-V with !defined(__riscv) in https://github.com/llvm/llvm-project/pull/94984 as a temporary workaround for a Clang 18/19 RV64 codegen bug (https://github.com/llvm/llvm-project/issues/107607). That bug was fixed in Clang 20 (https://github.com/llvm/llvm-project/pull/119481), and RISC-V f16 and cfloat16 entrypoints were already added in https://github.com/llvm/llvm-project/pull/138597. Also, fix cpu_features.h to require __riscv_zfh instead of __riscv_zfhmin for `LIBC_TARGET_CPU_HAS_RISCV_FPU_HALF` and `LIBC_TARGET_CPU_HAS_FPU_HALF` (Zfhmin only provides load/store/convert, not arithmetic or FMA), and include `LIBC_TARGET_CPU_HAS_RISCV_FPU_HALF` in `LIBC_TARGET_CPU_HAS_FAST_FLOAT16_OPS`. This resolves https://github.com/llvm/llvm-project/pull/242947#issuecomment-7312301904
Author
Parents
Loading