diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -161,6 +161,8 @@ umodti3.c ) +# TODO: Several "tf" files (and divtc3.c, but not multc3.c) are in +# GENERIC_SOURCES instead of here. set(GENERIC_TF_SOURCES addtf3.c comparetf2.c @@ -234,9 +236,19 @@ ) endif() -# These sources work on all x86 variants, but only x86 variants. -set(x86_ARCH_SOURCES - cpu_model.c +# These files are used on 32-bit and 64-bit x86. +set(x86_ARCH_SOURCES cpu_model.c) + +if (NOT MSVC) + set(x86_ARCH_SOURCES + ${x86_ARCH_SOURCES} + i386/fp_mode.c + ) +endif () + +# Implement extended-precision builtins, assuming long double is 80 bits. +# long double is not 80 bits on Android or MSVC. +set(x86_80_BIT_SOURCES divxc3.c fixxfdi.c fixxfti.c @@ -251,13 +263,6 @@ powixf2.c ) -if (NOT MSVC) - set(x86_ARCH_SOURCES - ${x86_ARCH_SOURCES} - i386/fp_mode.c - ) -endif () - if (NOT MSVC) set(x86_64_SOURCES ${GENERIC_SOURCES} @@ -265,12 +270,19 @@ ${x86_ARCH_SOURCES} x86_64/floatdidf.c x86_64/floatdisf.c - x86_64/floatdixf.c x86_64/floatundidf.S x86_64/floatundisf.S - x86_64/floatundixf.S ) + if (NOT ANDROID) + set(x86_64_SOURCES + ${x86_64_SOURCES} + ${x86_80_BIT_SOURCES} + x86_64/floatdixf.c + x86_64/floatundixf.S + ) + endif() + # Darwin x86_64 Haswell set(x86_64h_SOURCES ${x86_64_SOURCES}) @@ -290,10 +302,8 @@ i386/divdi3.S i386/floatdidf.S i386/floatdisf.S - i386/floatdixf.S i386/floatundidf.S i386/floatundisf.S - i386/floatundixf.S i386/lshrdi3.S i386/moddi3.S i386/muldi3.S @@ -301,6 +311,15 @@ i386/umoddi3.S ) + if (NOT ANDROID) + set(i386_SOURCES + ${i386_SOURCES} + ${x86_80_BIT_SOURCES} + i386/floatdixf.S + i386/floatundixf.S + ) + endif() + if (WIN32) set(i386_SOURCES ${i386_SOURCES} @@ -317,7 +336,6 @@ ${x86_ARCH_SOURCES} x86_64/floatdidf.c x86_64/floatdisf.c - x86_64/floatdixf.c ) set(i386_SOURCES ${GENERIC_SOURCES} ${x86_ARCH_SOURCES}) endif () # if (NOT MSVC)