[libc-commits] [libc] [libc] Fix _Float16 detection for x86 (PR #73947)
via libc-commits
libc-commits at lists.llvm.org
Thu Nov 30 06:51:53 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Guillaume Chatelet (gchatelet)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/73947.diff
1 Files Affected:
- (modified) libc/src/__support/macros/properties/float.h (+2-1)
``````````diff
diff --git a/libc/src/__support/macros/properties/float.h b/libc/src/__support/macros/properties/float.h
index 7e00ddc8f0cd327..4bafc3777a47146 100644
--- a/libc/src/__support/macros/properties/float.h
+++ b/libc/src/__support/macros/properties/float.h
@@ -13,6 +13,7 @@
#include "src/__support/macros/properties/architectures.h"
#include "src/__support/macros/properties/compiler.h"
+#include "src/__support/macros/properties/cpu_features.h"
#include "src/__support/macros/properties/os.h"
#include <float.h> // LDBL_MANT_DIG
@@ -30,7 +31,7 @@
#endif
// float16 support.
-#if defined(LIBC_TARGET_ARCH_IS_X86_64)
+#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
``````````
</details>
https://github.com/llvm/llvm-project/pull/73947
More information about the libc-commits
mailing list