Skip to content

Conversation

gchatelet
Copy link
Contributor

No description provided.

@gchatelet gchatelet requested a review from lntue November 30, 2023 14:51
@llvmbot llvmbot added the libc label Nov 30, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 30, 2023

@llvm/pr-subscribers-libc

Author: Guillaume Chatelet (gchatelet)

Changes

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 --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

@gchatelet gchatelet merged commit 2c976a1 into llvm:main Dec 1, 2023
@gchatelet gchatelet deleted the fix_float16_detection_on_x86 branch December 1, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants