diff --git a/libc/src/__support/FPUtil/FPBits.h b/libc/src/__support/FPUtil/FPBits.h index 1703e9a2bb3317..64bf2d0ac43825 100644 --- a/libc/src/__support/FPUtil/FPBits.h +++ b/libc/src/__support/FPUtil/FPBits.h @@ -804,8 +804,8 @@ template LIBC_INLINE static constexpr FPType get_fp_type() { else if constexpr (__LDBL_MANT_DIG__ == 113) return FPType::IEEE754_Binary128; } -#if defined(LIBC_COMPILER_HAS_C23_FLOAT16) - else if constexpr (cpp::is_same_v) +#if defined(LIBC_TYPES_HAS_FLOAT16) + else if constexpr (cpp::is_same_v) return FPType::IEEE754_Binary16; #endif #if defined(LIBC_COMPILER_HAS_C23_FLOAT128) diff --git a/libc/src/__support/macros/properties/types.h b/libc/src/__support/macros/properties/types.h index e812a9dfcfd8ab..4d84ae695c9a1c 100644 --- a/libc/src/__support/macros/properties/types.h +++ b/libc/src/__support/macros/properties/types.h @@ -27,28 +27,27 @@ #endif // float16 support. +// TODO: move this logic to "llvm-libc-types/float16.h" #if defined(LIBC_TARGET_ARCH_IS_X86_64) && defined(LIBC_TARGET_CPU_HAS_SSE2) #if (defined(LIBC_COMPILER_CLANG_VER) && (LIBC_COMPILER_CLANG_VER >= 1500)) || \ (defined(LIBC_COMPILER_GCC_VER) && (LIBC_COMPILER_GCC_VER >= 1201)) -#define LIBC_COMPILER_HAS_C23_FLOAT16 +#define LIBC_TYPES_HAS_FLOAT16 +using float16 = _Float16; #endif #endif #if defined(LIBC_TARGET_ARCH_IS_AARCH64) #if (defined(LIBC_COMPILER_CLANG_VER) && (LIBC_COMPILER_CLANG_VER >= 900)) || \ (defined(LIBC_COMPILER_GCC_VER) && (LIBC_COMPILER_GCC_VER >= 1301)) -#define LIBC_COMPILER_HAS_C23_FLOAT16 +#define LIBC_TYPES_HAS_FLOAT16 +using float16 = _Float16; #endif #endif #if defined(LIBC_TARGET_ARCH_IS_ANY_RISCV) #if (defined(LIBC_COMPILER_CLANG_VER) && (LIBC_COMPILER_CLANG_VER >= 1300)) || \ (defined(LIBC_COMPILER_GCC_VER) && (LIBC_COMPILER_GCC_VER >= 1301)) -#define LIBC_COMPILER_HAS_C23_FLOAT16 -#endif -#endif - -#if defined(LIBC_COMPILER_HAS_C23_FLOAT16) +#define LIBC_TYPES_HAS_FLOAT16 using float16 = _Float16; -#define LIBC_HAS_FLOAT16 +#endif #endif // float128 support.