diff --git a/src/libm/CMakeLists.txt b/src/libm/CMakeLists.txt index bdccfb203..c6d939e2b 100644 --- a/src/libm/CMakeLists.txt +++ b/src/libm/CMakeLists.txt @@ -3,15 +3,19 @@ project(darling-libsystem_m) cmake_minimum_required(VERSION 2.4.0) enable_language(C ASM) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2 -msse3 -w -ggdb -O0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__DARWIN_UNIX03 -fPIC -w -DBUILDING_FOR_CARBONCORE_LEGACY -funroll-loops -msse3") # -DBUILDING_FOR_CARBONCORE_LEGACY") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__DARWIN_UNIX03 -fPIC -w -ggdb -O0 -DBUILDING_FOR_CARBONCORE_LEGACY -funroll-loops") # -DBUILDING_FOR_CARBONCORE_LEGACY") set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DBUILDING_FOR_CARBONCORE_LEGACY") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib") -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source/Intel) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../libc/darwin) -add_definitions(-Dmovsxw=movswl -DPRIVATE) +add_definitions(-DPRIVATE) + +if (TARGET_i386 OR TARGET_x86_64) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2 -msse3") + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source/Intel) + add_definitions(-Dmovsxw=movsw) +endif () set(libm_sources Source/abs.c @@ -20,131 +24,135 @@ set(libm_sources #Source/nan.c #Source/nanl.c #Source/version_info.c - Source/Intel/acos.c - Source/Intel/asin.c - Source/Intel/atan.c - Source/Intel/complex.c - Source/Intel/containsNothingIntel.c - Source/Intel/e_acosh.c - Source/Intel/e_atanh.c - Source/Intel/e_cosh.c - Source/Intel/e_j0.c - Source/Intel/e_j1.c - Source/Intel/e_jn.c - Source/Intel/e_sinh.c - Source/Intel/expf_logf_powf.c - Source/Intel/fenv.c - Source/Intel/fmaf.c - Source/Intel/nan.c - Source/Intel/nanl.c - Source/Intel/rndtol.c - Source/Intel/s_asinh.c - Source/Intel/sincostan.c - Source/Intel/s_matherr.c - Source/Intel/s_tanh.c - Source/Intel/xmm_arcsincostan.c - Source/Intel/xmm_erfgamma.c - Source/Intel/xmm_exp.c - Source/Intel/xmm_fma.c - Source/Intel/xmm_log.c - Source/Intel/xmm_misc.c - Source/Intel/xmm_nextafter.c - Source/Intel/xmm_power.c - Source/Intel/xmm_remainder.c - Source/Intel/xmm_sqrt.c - - Source/Intel/acosf.S - Source/Intel/acoshf.S - Source/Intel/asinf.S - Source/Intel/asinhf.S - Source/Intel/atan2f.S - Source/Intel/atanf.S - Source/Intel/atanhf.S - Source/Intel/cbrtf.S - Source/Intel/ceilf.S - Source/Intel/ceill.S - Source/Intel/ceil.S - Source/Intel/copysign.S - Source/Intel/coshf.S - Source/Intel/cosh.S - Source/Intel/e_acos.S - Source/Intel/e_asin.S - Source/Intel/e_atan2.S - Source/Intel/e_cbrtl.S - Source/Intel/e_exp.S - Source/Intel/e_log10.S - Source/Intel/e_log.S - Source/Intel/e_remainder.S - #Source/Intel/e_remquol.S - Source/Intel/e_sqrt.S - Source/Intel/exp2f.S - Source/Intel/exp2.S - Source/Intel/expf.S - Source/Intel/expl.S - Source/Intel/expm1f.S - Source/Intel/expm1.S - Source/Intel/exp.S - Source/Intel/floorf.S - Source/Intel/floorl.S - Source/Intel/floor.S - Source/Intel/fmaxfminfdim.S - Source/Intel/fmod.S - Source/Intel/frexp.S - Source/Intel/fyl2x.S - Source/Intel/hypotf.S - Source/Intel/hypotl.S - Source/Intel/hypot.S - Source/Intel/ilogb.S - Source/Intel/log10f.S - Source/Intel/log2f.S - Source/Intel/log2.S - Source/Intel/logf.S - #Source/Intel/log.S - Source/Intel/lrintl.S - Source/Intel/lroundf.S - Source/Intel/lroundl.S - Source/Intel/lround.S - Source/Intel/modff.S - Source/Intel/modfl.S - Source/Intel/modf.S - Source/Intel/nearbyintf.S - Source/Intel/nearbyintl.S - Source/Intel/nearbyint.S - Source/Intel/nextafterf.S - Source/Intel/nextafterl.S - Source/Intel/nextafter.S - #Source/Intel/powf.S - Source/Intel/rintf.S - Source/Intel/rintl.S - Source/Intel/rint.S - Source/Intel/roundf.S - Source/Intel/roundl.S - Source/Intel/round.S - Source/Intel/s_atan.S - Source/Intel/scalbnf.S - Source/Intel/scalbnl.S - Source/Intel/scalbn.S - Source/Intel/s_cosisin.S - Source/Intel/s_cos.S - #Source/Intel/s_ilogb.S - Source/Intel/sinfcosf.S - Source/Intel/sinhf.S - Source/Intel/sinh.S - Source/Intel/s_log1p.S - #Source/Intel/s_logb.S - Source/Intel/s_rint.S - #Source/Intel/s_significand.S - Source/Intel/s_sin.S - Source/Intel/s_tan.S - Source/Intel/tanf.S - Source/Intel/tanhf.S - Source/Intel/tanh.S - Source/Intel/truncf.S - Source/Intel/truncl.S - Source/Intel/trunc.S - ) +if (TARGET_i386 OR TARGET_x86_64) + set(libm_sources ${libm_sources} + Source/Intel/acos.c + Source/Intel/asin.c + Source/Intel/atan.c + Source/Intel/complex.c + Source/Intel/containsNothingIntel.c + Source/Intel/e_acosh.c + Source/Intel/e_atanh.c + Source/Intel/e_cosh.c + Source/Intel/e_j0.c + Source/Intel/e_j1.c + Source/Intel/e_jn.c + Source/Intel/e_sinh.c + Source/Intel/expf_logf_powf.c + Source/Intel/fenv.c + Source/Intel/fmaf.c + Source/Intel/nan.c + Source/Intel/nanl.c + Source/Intel/rndtol.c + Source/Intel/s_asinh.c + Source/Intel/sincostan.c + Source/Intel/s_matherr.c + Source/Intel/s_tanh.c + Source/Intel/xmm_arcsincostan.c + Source/Intel/xmm_erfgamma.c + Source/Intel/xmm_exp.c + Source/Intel/xmm_fma.c + Source/Intel/xmm_log.c + Source/Intel/xmm_misc.c + Source/Intel/xmm_nextafter.c + Source/Intel/xmm_power.c + Source/Intel/xmm_remainder.c + Source/Intel/xmm_sqrt.c + + Source/Intel/acosf.S + Source/Intel/acoshf.S + Source/Intel/asinf.S + Source/Intel/asinhf.S + Source/Intel/atan2f.S + Source/Intel/atanf.S + Source/Intel/atanhf.S + Source/Intel/cbrtf.S + Source/Intel/ceilf.S + Source/Intel/ceill.S + Source/Intel/ceil.S + Source/Intel/copysign.S + Source/Intel/coshf.S + Source/Intel/cosh.S + Source/Intel/e_acos.S + Source/Intel/e_asin.S + Source/Intel/e_atan2.S + Source/Intel/e_cbrtl.S + Source/Intel/e_exp.S + Source/Intel/e_log10.S + Source/Intel/e_log.S + Source/Intel/e_remainder.S + #Source/Intel/e_remquol.S + Source/Intel/e_sqrt.S + Source/Intel/exp2f.S + Source/Intel/exp2.S + Source/Intel/expf.S + Source/Intel/expl.S + Source/Intel/expm1f.S + Source/Intel/expm1.S + Source/Intel/exp.S + Source/Intel/floorf.S + Source/Intel/floorl.S + Source/Intel/floor.S + Source/Intel/fmaxfminfdim.S + Source/Intel/fmod.S + Source/Intel/frexp.S + Source/Intel/fyl2x.S + Source/Intel/hypotf.S + Source/Intel/hypotl.S + Source/Intel/hypot.S + Source/Intel/ilogb.S + Source/Intel/log10f.S + Source/Intel/log2f.S + Source/Intel/log2.S + Source/Intel/logf.S + #Source/Intel/log.S + Source/Intel/lrintl.S + Source/Intel/lroundf.S + Source/Intel/lroundl.S + Source/Intel/lround.S + Source/Intel/modff.S + Source/Intel/modfl.S + Source/Intel/modf.S + Source/Intel/nearbyintf.S + Source/Intel/nearbyintl.S + Source/Intel/nearbyint.S + Source/Intel/nextafterf.S + Source/Intel/nextafterl.S + Source/Intel/nextafter.S + #Source/Intel/powf.S + Source/Intel/rintf.S + Source/Intel/rintl.S + Source/Intel/rint.S + Source/Intel/roundf.S + Source/Intel/roundl.S + Source/Intel/round.S + Source/Intel/s_atan.S + Source/Intel/scalbnf.S + Source/Intel/scalbnl.S + Source/Intel/scalbn.S + Source/Intel/s_cosisin.S + Source/Intel/s_cos.S + #Source/Intel/s_ilogb.S + Source/Intel/sinfcosf.S + Source/Intel/sinhf.S + Source/Intel/sinh.S + Source/Intel/s_log1p.S + #Source/Intel/s_logb.S + Source/Intel/s_rint.S + #Source/Intel/s_significand.S + Source/Intel/s_sin.S + Source/Intel/s_tan.S + Source/Intel/tanf.S + Source/Intel/tanhf.S + Source/Intel/tanh.S + Source/Intel/truncf.S + Source/Intel/truncl.S + Source/Intel/trunc.S + ) +endif () + # Gross hack to rename symbols in $fenv_access_off variants set(CMAKE_AR "${CMAKE_CURRENT_SOURCE_DIR}/rename_wrapper") @@ -152,8 +160,12 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/darling SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -add_darling_object_library(system_m_extra Source/Intel/xmm_misc.c Source/Intel/xmm_log.c Source/Intel/fmaxfminfdim.S Source/Intel/nextafter.S Source/Intel/xmm_remainder.c Source/Intel/e_remquol.S) -set_target_properties(system_m_extra PROPERTIES COMPILE_FLAGS "-UBUILDING_FOR_CARBONCORE_LEGACY -O0 -ggdb") +if (TARGET_i386 OR TARGET_x86_64) + add_darling_object_library(system_m_extra Source/Intel/xmm_misc.c Source/Intel/xmm_log.c Source/Intel/fmaxfminfdim.S Source/Intel/nextafter.S Source/Intel/xmm_remainder.c Source/Intel/e_remquol.S) + set_target_properties(system_m_extra PROPERTIES COMPILE_FLAGS "-UBUILDING_FOR_CARBONCORE_LEGACY -O0 -ggdb") +else () + add_darling_object_library(system_m_extra Source/empty.c) +endif () make_fat(system_m_extra) set(DYLIB_INSTALL_NAME "/usr/lib/system/libsystem_m.dylib") diff --git a/src/libm/Source/ARM/acoshf.s b/src/libm/Source/ARM/acoshf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/asinf.s b/src/libm/Source/ARM/asinf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/asinhf.s b/src/libm/Source/ARM/asinhf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/atan2.s b/src/libm/Source/ARM/atan2.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/atan2f.s b/src/libm/Source/ARM/atan2f.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/atanhf.s b/src/libm/Source/ARM/atanhf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/cbrtf.s b/src/libm/Source/ARM/cbrtf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/ceil.s b/src/libm/Source/ARM/ceil.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/ceilf.s b/src/libm/Source/ARM/ceilf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/copysign.s b/src/libm/Source/ARM/copysign.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/cosf.s b/src/libm/Source/ARM/cosf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/coshf.s b/src/libm/Source/ARM/coshf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/exp.s b/src/libm/Source/ARM/exp.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/exp2.s b/src/libm/Source/ARM/exp2.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/exp2f.s b/src/libm/Source/ARM/exp2f.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/expf.s b/src/libm/Source/ARM/expf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/expm1f.s b/src/libm/Source/ARM/expm1f.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/fabs.s b/src/libm/Source/ARM/fabs.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/fabsf.s b/src/libm/Source/ARM/fabsf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/floor.s b/src/libm/Source/ARM/floor.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/floorf.s b/src/libm/Source/ARM/floorf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/fmax.s b/src/libm/Source/ARM/fmax.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/fmaxf.s b/src/libm/Source/ARM/fmaxf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/fmin.s b/src/libm/Source/ARM/fmin.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/fminf.s b/src/libm/Source/ARM/fminf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/fmod.s b/src/libm/Source/ARM/fmod.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/frexp.s b/src/libm/Source/ARM/frexp.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/frexpf.s b/src/libm/Source/ARM/frexpf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/hypot.s b/src/libm/Source/ARM/hypot.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/hypotf.s b/src/libm/Source/ARM/hypotf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/ldexp.s b/src/libm/Source/ARM/ldexp.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/ldexpf.s b/src/libm/Source/ARM/ldexpf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/llrintf.s b/src/libm/Source/ARM/llrintf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/llroundf.s b/src/libm/Source/ARM/llroundf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/log.s b/src/libm/Source/ARM/log.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/log2.s b/src/libm/Source/ARM/log2.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/logf.s b/src/libm/Source/ARM/logf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/lrintf.s b/src/libm/Source/ARM/lrintf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/lround.s b/src/libm/Source/ARM/lround.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/lroundf.s b/src/libm/Source/ARM/lroundf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/modf.s b/src/libm/Source/ARM/modf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/modff.s b/src/libm/Source/ARM/modff.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/nearbyintf.s b/src/libm/Source/ARM/nearbyintf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/pow.s b/src/libm/Source/ARM/pow.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/powf.s b/src/libm/Source/ARM/powf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/round.s b/src/libm/Source/ARM/round.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/roundf.s b/src/libm/Source/ARM/roundf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/sincos.s b/src/libm/Source/ARM/sincos.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/sinf.s b/src/libm/Source/ARM/sinf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/sinhf.s b/src/libm/Source/ARM/sinhf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/tan.s b/src/libm/Source/ARM/tan.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/tanf.s b/src/libm/Source/ARM/tanf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/tanhf.s b/src/libm/Source/ARM/tanhf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/trunc.s b/src/libm/Source/ARM/trunc.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/truncf.s b/src/libm/Source/ARM/truncf.s deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/libm/Source/ARM/acosf.s b/src/libm/Source/empty.c similarity index 100% rename from src/libm/Source/ARM/acosf.s rename to src/libm/Source/empty.c