[libc-commits] [libc] e3735ce - [libc][math] Disable float16 on Clang 11 and older (#183574)

via libc-commits libc-commits at lists.llvm.org
Thu Feb 26 10:47:34 PST 2026


Author: Muhammad Bassiouni
Date: 2026-02-26T20:47:29+02:00
New Revision: e3735ce4b344a5b6177546ecf40904bedb852f09

URL: https://github.com/llvm/llvm-project/commit/e3735ce4b344a5b6177546ecf40904bedb852f09
DIFF: https://github.com/llvm/llvm-project/commit/e3735ce4b344a5b6177546ecf40904bedb852f09.diff

LOG: [libc][math] Disable float16 on Clang 11 and older (#183574)

This also reverts
https://github.com/llvm/llvm-project/commit/c5d6feb3152bf39d820935df0d0490f90364d44c

Added: 
    

Modified: 
    libc/include/llvm-libc-macros/float16-macros.h
    libc/test/shared/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/include/llvm-libc-macros/float16-macros.h b/libc/include/llvm-libc-macros/float16-macros.h
index 229e3e62f2aed..528c7f016f873 100644
--- a/libc/include/llvm-libc-macros/float16-macros.h
+++ b/libc/include/llvm-libc-macros/float16-macros.h
@@ -12,7 +12,8 @@
 #include "../llvm-libc-types/float128.h"
 
 #if defined(__FLT16_MANT_DIG__) &&                                             \
-    (!defined(__GNUC__) || __GNUC__ >= 13 || defined(__clang__)) &&            \
+    (!defined(__GNUC__) || __GNUC__ >= 13 ||                                   \
+     (defined(__clang__) && __clang_major__ >= 12)) &&                         \
     !defined(__arm__) && !defined(_M_ARM) && !defined(__riscv) &&              \
     !defined(_WIN32)
 #define LIBC_TYPES_HAS_FLOAT16

diff  --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt
index e8fbd54438b86..08bfccadc7682 100644
--- a/libc/test/shared/CMakeLists.txt
+++ b/libc/test/shared/CMakeLists.txt
@@ -1,5 +1,3 @@
-if(NOT LIBC_TARGET_ARCHITECTURE_IS_AARCH64)
-
 add_custom_target(libc-shared-tests)
 
 add_fp_unittest(
@@ -223,5 +221,3 @@ add_fp_unittest(
     libc.src.__support.math.tanpif
     libc.src.__support.math.tanpif16
 )
-
-endif()


        


More information about the libc-commits mailing list