[PATCH] D53608: [builtins] Build float128 soft float builtins for x86_64.

Manoj Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 23 13:38:15 PDT 2018


manojgupta created this revision.
manojgupta added reviewers: efriedma, joerg.
Herald added subscribers: Sanitizers, llvm-commits, delcypher, mgorny.

float128 builtins are currently not built for x86_64.
This causes linker to complain baout missing symbols when linking
glibc 2.27 with float128 support.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D53608

Files:
  lib/builtins/CMakeLists.txt
  lib/builtins/fp_lib.h


Index: lib/builtins/fp_lib.h
===================================================================
--- lib/builtins/fp_lib.h
+++ lib/builtins/fp_lib.h
@@ -103,11 +103,12 @@
 COMPILER_RT_ABI fp_t __adddf3(fp_t a, fp_t b);
 
 #elif defined QUAD_PRECISION
-#if __LDBL_MANT_DIG__ == 113
+// __LDBL_MANT_DIG__ is set to 64 for x86_64.
+#if __LDBL_MANT_DIG__ == 113 || defined(__x86_64__)
 #define CRT_LDBL_128BIT
 typedef __uint128_t rep_t;
 typedef __int128_t srep_t;
-typedef long double fp_t;
+typedef __float128 fp_t;
 #define REP_C (__uint128_t)
 // Note: Since there is no explicit way to tell compiler the constant is a
 // 128-bit integer, we let the constant be casted to 128-bit integer
Index: lib/builtins/CMakeLists.txt
===================================================================
--- lib/builtins/CMakeLists.txt
+++ lib/builtins/CMakeLists.txt
@@ -232,6 +232,7 @@
 
 if (NOT MSVC)
   set(x86_64_SOURCES
+      ${GENERIC_TF_SOURCES}
       x86_64/floatdidf.c
       x86_64/floatdisf.c
       x86_64/floatdixf.c


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53608.170743.patch
Type: text/x-patch
Size: 1023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181023/5c895903/attachment.bin>


More information about the cfe-commits mailing list