Skip to content

[libc] Exclude Fuchsia from float128 detection #73985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

Caslyn
Copy link
Contributor

@Caslyn Caslyn commented Nov 30, 2023

Following from #73372:

Fuchsia targets currently don't support float128. Add detection for LIBC_TARGET_OS_IS_FUCHSIA, and exclude this OS from setting LIBC_COMPILER_HAS_FLOAT128_EXTENSION.

Fuchsia targets currently don't support `float128`. Add detection for
`LIBC_TARGET_OS_IS_FUCHSIA`, and exclude this OS from setting
`LIBC_COMPILER_HAS_FLOAT128_EXTENSION`.
@Caslyn Caslyn self-assigned this Nov 30, 2023
@llvmbot llvmbot added the libc label Nov 30, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 30, 2023

@llvm/pr-subscribers-libc

Author: Caslyn Tonelli (Caslyn)

Changes

Following from #73372:

Fuchsia targets currently don't support float128. Add detection for LIBC_TARGET_OS_IS_FUCHSIA, and exclude this OS from setting LIBC_COMPILER_HAS_FLOAT128_EXTENSION.


Full diff: https://github.com/llvm/llvm-project/pull/73985.diff

2 Files Affected:

  • (modified) libc/src/__support/macros/properties/float.h (+2-1)
  • (modified) libc/src/__support/macros/properties/os.h (+4)
diff --git a/libc/src/__support/macros/properties/float.h b/libc/src/__support/macros/properties/float.h
index 7e00ddc8f0cd327..69d3ec400c37c53 100644
--- a/libc/src/__support/macros/properties/float.h
+++ b/libc/src/__support/macros/properties/float.h
@@ -62,7 +62,8 @@ using float16 = _Float16;
 #define LIBC_COMPILER_HAS_C23_FLOAT128
 #endif
 #if (defined(LIBC_COMPILER_CLANG_VER) && (LIBC_COMPILER_CLANG_VER >= 500)) &&  \
-    (defined(LIBC_TARGET_ARCH_IS_X86_64))
+    (defined(LIBC_TARGET_ARCH_IS_X86_64) &&                                    \
+     !defined(LIBC_TARGET_OS_IS_FUCHSIA))
 #define LIBC_COMPILER_HAS_FLOAT128_EXTENSION
 #endif
 
diff --git a/libc/src/__support/macros/properties/os.h b/libc/src/__support/macros/properties/os.h
index 92e68b3e6612a82..ff0b29fd50c1751 100644
--- a/libc/src/__support/macros/properties/os.h
+++ b/libc/src/__support/macros/properties/os.h
@@ -37,4 +37,8 @@
 #endif
 #endif
 
+#if (defined(__Fuchsia__))
+#define LIBC_TARGET_OS_IS_FUCHSIA
+#endif
+
 #endif // LLVM_LIBC_SRC___SUPPORT_MACROS_PROPERTIES_OS_H

Copy link
Contributor

@gchatelet gchatelet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the double parentheses and feel free to merge.

@Caslyn Caslyn merged commit 3693f44 into llvm:main Dec 1, 2023
@Caslyn Caslyn deleted the fuchsia-float-detection branch December 1, 2023 18:30
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.

4 participants