Skip to content

Commit 07f8efa

Browse files
authored
[libc][NFC] Don't expose how float16 and float128 types are provided (#83818)
Umbrella bug #83182
1 parent 52a460f commit 07f8efa

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

libc/include/llvm-libc-types/float128.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@
1919
// https://github.com/llvm/llvm-project/issues/80195
2020
#if defined(__STDC_IEC_60559_BFP__) && !defined(__clang__) && \
2121
!defined(__cplusplus)
22-
// Use _Float128 C23 type.
23-
#define LIBC_COMPILER_HAS_C23_FLOAT128
22+
#define LIBC_TYPES_HAS_FLOAT128
2423
typedef _Float128 float128;
2524
#elif defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
2625
// Use __float128 type. gcc and clang sometime use __SIZEOF_FLOAT128__ to
2726
// notify the availability of __float128.
2827
// clang also uses __FLOAT128__ macro to notify the availability of __float128
2928
// type: https://reviews.llvm.org/D15120
30-
#define LIBC_COMPILER_HAS_FLOAT128_EXTENSION
29+
#define LIBC_TYPES_HAS_FLOAT128
3130
typedef __float128 float128;
3231
#elif (LDBL_MANT_DIG == 113)
33-
// Use long double.
32+
#define LIBC_TYPES_HAS_FLOAT128
3433
typedef long double float128;
3534
#endif
3635

libc/src/__support/macros/properties/types.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define LIBC_TYPES_LONG_DOUBLE_IS_FLOAT128
2727
#endif
2828

29-
// float16 support.
29+
// -- float16 support ---------------------------------------------------------
3030
// TODO: move this logic to "llvm-libc-types/float16.h"
3131
#if defined(LIBC_TARGET_ARCH_IS_X86_64) && defined(LIBC_TARGET_CPU_HAS_SSE2)
3232
#if (defined(LIBC_COMPILER_CLANG_VER) && (LIBC_COMPILER_CLANG_VER >= 1500)) || \
@@ -50,11 +50,8 @@ using float16 = _Float16;
5050
#endif
5151
#endif
5252

53-
// float128 support.
54-
#if defined(LIBC_COMPILER_HAS_C23_FLOAT128) || \
55-
defined(LIBC_COMPILER_HAS_FLOAT128_EXTENSION) || \
56-
defined(LIBC_TYPES_LONG_DOUBLE_IS_FLOAT128)
57-
#define LIBC_TYPES_HAS_FLOAT128
58-
#endif
53+
// -- float128 support --------------------------------------------------------
54+
// LIBC_TYPES_HAS_FLOAT128 and 'float128' type are provided by
55+
// "include/llvm-libc-types/float128.h"
5956

6057
#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_PROPERTIES_TYPES_H

0 commit comments

Comments
 (0)