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