From cf99afd4fc1268590f7355ad824cb6348858cf8f Mon Sep 17 00:00:00 2001 From: Xu Han Date: Tue, 13 Feb 2024 01:33:10 +0800 Subject: [PATCH 1/3] fix warning. --- src/libm/sleefsimddp.c | 4 ++-- src/libm/sleefsimdsp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libm/sleefsimddp.c b/src/libm/sleefsimddp.c index d8d17a70..26b0f13a 100644 --- a/src/libm/sleefsimddp.c +++ b/src/libm/sleefsimddp.c @@ -23,9 +23,9 @@ extern const double Sleef_rempitabdp[]; #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) -#endif - +#else #pragma STDC FP_CONTRACT OFF +#endif // Intel diff --git a/src/libm/sleefsimdsp.c b/src/libm/sleefsimdsp.c index 27bfda0f..f360b165 100644 --- a/src/libm/sleefsimdsp.c +++ b/src/libm/sleefsimdsp.c @@ -23,9 +23,9 @@ extern const float Sleef_rempitabsp[]; #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) -#endif - +#else #pragma STDC FP_CONTRACT OFF +#endif // Intel From 49166f97dba9b7a287fdfde4f368c119827fb84a Mon Sep 17 00:00:00 2001 From: Xu Han Date: Tue, 13 Feb 2024 02:05:37 +0800 Subject: [PATCH 2/3] fix SLEEF_BUILD_SCALAR_LIB lost function. --- src/libm/CMakeLists.txt | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/libm/CMakeLists.txt b/src/libm/CMakeLists.txt index 25e11775..d0938750 100644 --- a/src/libm/CMakeLists.txt +++ b/src/libm/CMakeLists.txt @@ -972,25 +972,24 @@ endif() # TARGET_LIBSLEEFSCALAR # -------------------------------------------------------------------- # Build scalar-only library from sleefdp.c and sleefsp.c +if(SLEEF_BUILD_SCALAR_LIB) + add_library(sleefscalar sleefdp.c sleefsp.c rempitab.c) + add_dependencies(sleefscalar ${TARGET_HEADERS}) + set_target_properties(sleefscalar PROPERTIES + VERSION ${SLEEF_VERSION} + SOVERSION ${SLEEF_SOVERSION} + PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER} + ${COMMON_TARGET_PROPERTIES} + ) -add_library(sleefscalar sleefdp.c sleefsp.c rempitab.c) -add_dependencies(sleefscalar ${TARGET_HEADERS}) -set_target_properties(sleefscalar PROPERTIES - VERSION ${SLEEF_VERSION} - SOVERSION ${SLEEF_SOVERSION} - PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER} - ${COMMON_TARGET_PROPERTIES} -) - -target_compile_definitions(sleefscalar - PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS} -) + target_compile_definitions(sleefscalar + PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS} + ) -if(COMPILER_SUPPORTS_BUILTIN_MATH) - target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1) -endif() + if(COMPILER_SUPPORTS_BUILTIN_MATH) + target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1) + endif() -if(SLEEF_BUILD_SCALAR_LIB) install( TARGETS sleefscalar EXPORT sleefTargets From 4526449fb0198e6d25edaff55e27c7edfa50e66b Mon Sep 17 00:00:00 2001 From: Xu Han Date: Wed, 6 Mar 2024 21:23:40 +0800 Subject: [PATCH 3/3] fix more files. --- src/libm/sleefdp.c | 4 ++-- src/libm/sleefinline_header.h.org | 4 ++-- src/libm/sleefsp.c | 4 ++-- src/quad/sleefquadinline_cuda_header.h.org | 2 ++ src/quad/sleefquadinline_header.h.org | 4 ++-- src/quad/sleefsimdqp.c | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/libm/sleefdp.c b/src/libm/sleefdp.c index 985073a9..e5ffd857 100644 --- a/src/libm/sleefdp.c +++ b/src/libm/sleefdp.c @@ -28,9 +28,9 @@ extern const double Sleef_rempitabdp[]; #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) -#endif - +#else #pragma STDC FP_CONTRACT OFF +#endif #define MLA mla #define C2V(x) (x) diff --git a/src/libm/sleefinline_header.h.org b/src/libm/sleefinline_header.h.org index df0c8215..0b19d593 100644 --- a/src/libm/sleefinline_header.h.org +++ b/src/libm/sleefinline_header.h.org @@ -18,9 +18,9 @@ #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) -#endif - +#else #pragma STDC FP_CONTRACT OFF +#endif #ifndef SLEEF_FP_ILOGB0 #define SLEEF_FP_ILOGB0 ((int)0x80000000) diff --git a/src/libm/sleefsp.c b/src/libm/sleefsp.c index aa325f42..7d53b573 100644 --- a/src/libm/sleefsp.c +++ b/src/libm/sleefsp.c @@ -28,9 +28,9 @@ extern const float Sleef_rempitabsp[]; #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) -#endif - +#else #pragma STDC FP_CONTRACT OFF +#endif #define MLA mlaf #define C2V(x) (x) diff --git a/src/quad/sleefquadinline_cuda_header.h.org b/src/quad/sleefquadinline_cuda_header.h.org index d815a729..15ee0cce 100644 --- a/src/quad/sleefquadinline_cuda_header.h.org +++ b/src/quad/sleefquadinline_cuda_header.h.org @@ -17,6 +17,8 @@ #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF #endif __device__ const double Sleef_rempitabqp[] = { diff --git a/src/quad/sleefquadinline_header.h.org b/src/quad/sleefquadinline_header.h.org index 0986f6fb..80fd2225 100644 --- a/src/quad/sleefquadinline_header.h.org +++ b/src/quad/sleefquadinline_header.h.org @@ -18,9 +18,9 @@ #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) -#endif - +#else #pragma STDC FP_CONTRACT OFF +#endif #ifndef SLEEF_FP_ILOGB0 #define SLEEF_FP_ILOGB0 ((int)0x80000000) diff --git a/src/quad/sleefsimdqp.c b/src/quad/sleefsimdqp.c index db4bba95..dafab44a 100644 --- a/src/quad/sleefsimdqp.c +++ b/src/quad/sleefsimdqp.c @@ -23,9 +23,9 @@ extern const double Sleef_rempitabqp[]; #if defined(_MSC_VER) && !defined (__clang__) #pragma fp_contract (off) -#endif - +#else #pragma STDC FP_CONTRACT OFF +#endif #ifdef ENABLE_PUREC_SCALAR #define CONFIG 1