diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 5a338cfb..59104383 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -19,14 +19,14 @@ env: LLVM_VERSION: "17" COMMON_CMAKE_FLAGS: | -DSLEEF_SHOW_CONFIG=1 - -DBUILD_GNUABI_LIBS=ON - -DBUILD_INLINE_HEADERS=ON - -DBUILD_DFT=ON - -DBUILD_QUAD=ON - -DBUILD_SCALAR_LIB=ON - -DBUILD_STATIC_TEST_BINS=ON - -DENFORCE_TESTER=ON - -DENFORCE_TESTER3=ON + -DSLEEF_BUILD_GNUABI_LIBS=ON + -DSLEEF_BUILD_INLINE_HEADERS=ON + -DSLEEF_BUILD_DFT=ON + -DSLEEF_BUILD_QUAD=ON + -DSLEEF_BUILD_SCALAR_LIB=ON + -DSLEEF_BUILD_STATIC_TEST_BINS=ON + -DSLEEF_ENFORCE_TESTER=ON + -DSLEEF_ENFORCE_TESTER3=ON jobs: build-native: @@ -64,7 +64,7 @@ jobs: - name: Build native shell: bash -ex -o pipefail {0} run: | - EXTRA_CMAKE_FLAGS="-DENFORCE_SSE2=ON -DENFORCE_SSE4=ON -DENFORCE_AVX=ON -DENFORCE_AVX=ON -DENFORCE_AVX2=ON -DENFORCE_AVX512F=ON -DENFORCE_FMA4=ON" + EXTRA_CMAKE_FLAGS="-DSLEEF_ENFORCE_SSE2=ON -DSLEEF_ENFORCE_SSE4=ON -DSLEEF_ENFORCE_AVX=ON -DSLEEF_ENFORCE_AVX=ON -DSLEEF_ENFORCE_AVX2=ON -DSLEEF_ENFORCE_AVX512F=ON -DSLEEF_ENFORCE_FMA4=ON" cmake -S . -B _build-native -GNinja \ -DCMAKE_INSTALL_PREFIX=$(pwd)/_install-native \ -DCMAKE_TOOLCHAIN_FILE=$(pwd)/toolchains/native-${{ matrix.compiler }}.cmake \ @@ -213,24 +213,24 @@ jobs: run: | EXTRA_CMAKE_FLAGS="" if [[ ${{ matrix.arch }} = "aarch64" ]]; then - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DENFORCE_SVE=ON" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_SVE=ON" elif [[ ${{ matrix.arch }} = "armhf" ]]; then # Disable inline headers, they just don't compile on armhf - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DBUILD_INLINE_HEADERS=OFF" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_BUILD_INLINE_HEADERS=OFF" elif [[ ${{ matrix.arch }} = "ppc64el" ]]; then - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DENFORCE_VSX=ON -DENFORCE_VSX3=ON" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_VSX=ON -DSLEEF_ENFORCE_VSX3=ON" elif [[ ${{ matrix.arch }} = "s390x" ]]; then - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DENFORCE_VXE=ON" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_VXE=ON" # Disable VXE2 support, QEMU doesn't support some instructions generated by gcc or llvm - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DDISABLE_VXE2=ON" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_DISABLE_VXE2=ON" elif [[ ${{ matrix.arch }} = "riscv64" ]]; then - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DENFORCE_RVVM1=ON -DENFORCE_RVVM2=ON" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_RVVM1=ON -DSLEEF_ENFORCE_RVVM2=ON" # Disable inline headers, they just don't compile on riscv64 - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DBUILD_INLINE_HEADERS=OFF" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_BUILD_INLINE_HEADERS=OFF" # Disable dft, it fails with linker error to `cexp` - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DBUILD_DFT=OFF" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_BUILD_DFT=OFF" # Disable quad, it's missing the `Sleef_quad` function - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DBUILD_QUAD=OFF" + EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_BUILD_QUAD=OFF" fi cmake -S . -B _build-${{ matrix.arch }} -GNinja \ diff --git a/CMakeLists.txt b/CMakeLists.txt index ff5cbba9..a90bc4df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,34 +1,33 @@ # Options -option(BUILD_SHARED_LIBS "Build shared libs" ON) -option(BUILD_STATIC_TEST_BINS "Build statically linked test executables" OFF) -option(ENABLE_LTO "Enable LTO on GCC or ThinLTO on clang" OFF) -option(BUILD_LIBM "libsleef will be built." ON) -option(BUILD_DFT "libsleefdft will be built." OFF) -option(BUILD_QUAD "libsleefquad will be built." OFF) -option(BUILD_GNUABI_LIBS "libsleefgnuabi will be built." ON) -option(BUILD_SCALAR_LIB "libsleefscalar will be built." OFF) -option(BUILD_TESTS "Tests will be built." ON) -option(BUILD_INLINE_HEADERS "Build header for inlining whole SLEEF functions" OFF) +option(SLEEF_BUILD_STATIC_TEST_BINS "Build statically linked test executables" OFF) +option(SLEEF_ENABLE_LTO "Enable LTO on GCC or ThinLTO on clang" OFF) +option(SLEEF_BUILD_LIBM "libsleef will be built." ON) +option(SLEEF_BUILD_DFT "libsleefdft will be built." OFF) +option(SLEEF_BUILD_QUAD "libsleefquad will be built." OFF) +option(SLEEF_BUILD_GNUABI_LIBS "libsleefgnuabi will be built." ON) +option(SLEEF_BUILD_SCALAR_LIB "libsleefscalar will be built." OFF) +option(SLEEF_BUILD_TESTS "Tests will be built." ON) +option(SLEEF_BUILD_INLINE_HEADERS "Build header for inlining whole SLEEF functions" OFF) option(SLEEF_TEST_ALL_IUT "Perform tests on implementations with all vector extensions" OFF) option(SLEEF_SHOW_CONFIG "Show SLEEF configuration status messages." ON) option(SLEEF_SHOW_ERROR_LOG "Show cmake error log." OFF) option(SLEEF_ASAN "Enable address sanitizing on all targets." OFF) -option(ENFORCE_TESTER "Build fails if tester is not available" OFF) -option(ENFORCE_TESTER3 "Build fails if tester3 is not built" OFF) +option(SLEEF_ENFORCE_TESTER "Build fails if tester is not available" OFF) +option(SLEEF_ENFORCE_TESTER3 "Build fails if tester3 is not built" OFF) -option(ENABLE_ALTDIV "Enable alternative division method (aarch64 only)" OFF) -option(ENABLE_ALTSQRT "Enable alternative sqrt method (aarch64 only)" OFF) +option(SLEEF_ENABLE_ALTDIV "Enable alternative division method (aarch64 only)" OFF) +option(SLEEF_ENABLE_ALTSQRT "Enable alternative sqrt method (aarch64 only)" OFF) -option(DISABLE_FFTW "Disable testing the DFT library with FFTW" OFF) -option(DISABLE_MPFR "Disable testing with the MPFR library" OFF) -option(DISABLE_SSL "Disable testing with the SSL library" OFF) +option(SLEEF_DISABLE_FFTW "Disable testing the DFT library with FFTW" OFF) +option(SLEEF_DISABLE_MPFR "Disable testing with the MPFR library" OFF) +option(SLEEF_DISABLE_SSL "Disable testing with the SSL library" OFF) -option(ENABLE_CUDA "Enable CUDA" OFF) -option(ENABLE_CXX "Enable C++" OFF) +option(SLEEF_ENABLE_CUDA "Enable CUDA" OFF) +option(SLEEF_ENABLE_CXX "Enable C++" OFF) # Function used to generate safe command arguments for add_custom_command function(command_arguments PROPNAME) @@ -129,11 +128,11 @@ set(SLEEF_SOVERSION ${SLEEF_VERSION_MAJOR}) set(LANGLIST C) -if (ENABLE_CUDA) +if (SLEEF_ENABLE_CUDA) set(LANGLIST ${LANGLIST} CUDA) endif() -if (ENABLE_CXX) +if (SLEEF_ENABLE_CXX) set(LANGLIST ${LANGLIST} CXX) endif() @@ -158,11 +157,11 @@ separate build directory. Note: Please remove autogenerated file \ `CMakeCache.txt` and directory `CMakeFiles` in the current directory.") endif() -if(ENABLE_LTO AND BUILD_SHARED_LIBS) - message(FATAL_ERROR "ENABLE_LTO and BUILD_SHARED_LIBS cannot be specified at the same time") -endif(ENABLE_LTO AND BUILD_SHARED_LIBS) +if(SLEEF_ENABLE_LTO AND BUILD_SHARED_LIBS) + message(FATAL_ERROR "SLEEF_ENABLE_LTO and BUILD_SHARED_LIBS cannot be specified at the same time") +endif(SLEEF_ENABLE_LTO AND BUILD_SHARED_LIBS) -if(ENABLE_LTO) +if(SLEEF_ENABLE_LTO) cmake_policy(SET CMP0069 NEW) include(CheckIPOSupported) check_ipo_supported(RESULT supported OUTPUT error) @@ -307,7 +306,7 @@ if(SLEEF_SHOW_CONFIG) endif(CMAKE_CROSSCOMPILING) message(STATUS "Using option `${SLEEF_C_FLAGS}` to compile libsleef") message(STATUS "Building shared libs : " ${BUILD_SHARED_LIBS}) - message(STATUS "Building static test bins: " ${BUILD_STATIC_TEST_BINS}) + message(STATUS "Building static test bins: " ${SLEEF_BUILD_STATIC_TEST_BINS}) message(STATUS "MPFR : " ${LIB_MPFR}) if (MPFR_INCLUDE_DIR) message(STATUS "MPFR header file in " ${MPFR_INCLUDE_DIR}) @@ -317,7 +316,7 @@ if(SLEEF_SHOW_CONFIG) message(STATUS "FFTW3 : " ${LIBFFTW3}) message(STATUS "OPENSSL : " ${OPENSSL_VERSION}) message(STATUS "SDE : " ${SDE_COMMAND}) - if (BUILD_INLINE_HEADERS) + if (SLEEF_BUILD_INLINE_HEADERS) message(STATUS "SED : " ${SED_COMMAND}) endif() message(STATUS "COMPILER_SUPPORTS_OPENMP : " ${COMPILER_SUPPORTS_OPENMP}) diff --git a/CMakeLists.txt.nested b/CMakeLists.txt.nested index 4b75ea05..03449822 100644 --- a/CMakeLists.txt.nested +++ b/CMakeLists.txt.nested @@ -16,7 +16,7 @@ target_link_libraries(hellox86 sleef) # -if (BUILD_DFT) +if (SLEEF_BUILD_DFT) add_executable(dfttutorial tutorial.c) set_target_properties(dfttutorial PROPERTIES C_STANDARD 99) add_dependencies(dfttutorial sleef) diff --git a/Configure.cmake b/Configure.cmake index f31e7b98..26d86ad9 100644 --- a/Configure.cmake +++ b/Configure.cmake @@ -5,7 +5,7 @@ include(CheckLanguage) # -if (BUILD_STATIC_TEST_BINS) +if (SLEEF_BUILD_STATIC_TEST_BINS) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(BUILD_SHARED_LIBS OFF) set(CMAKE_EXE_LINKER_FLAGS "-static") @@ -18,7 +18,7 @@ if (NOT CMAKE_CROSSCOMPILING AND NOT SLEEF_FORCE_FIND_PACKAGE_SSL) set(SLEEF_OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES}) # Work around for tester3 sig segv, when linking versions of openssl (1.1.1) statically. # This is a known issue https://github.com/openssl/openssl/issues/13872. - if (BUILD_STATIC_TEST_BINS) + if (SLEEF_BUILD_STATIC_TEST_BINS) string(REGEX REPLACE "-lpthread" "-Wl,--whole-archive -lpthread -Wl,--no-whole-archive" SLEEF_OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES}") @@ -37,8 +37,8 @@ else() endif() endif() -if (ENFORCE_TESTER3 AND NOT SLEEF_OPENSSL_FOUND) - message(FATAL_ERROR "ENFORCE_TESTER3 is specified and OpenSSL not found") +if (SLEEF_ENFORCE_TESTER3 AND NOT SLEEF_OPENSSL_FOUND) + message(FATAL_ERROR "SLEEF_ENFORCE_TESTER3 is specified and OpenSSL not found") endif() # Some toolchains require explicit linking of the libraries following. @@ -68,11 +68,11 @@ if (NOT LIBRT) set(LIBRT "") endif() -if (DISABLE_MPFR) +if (SLEEF_DISABLE_MPFR) set(LIB_MPFR "") endif() -if (DISABLE_SSL) +if (SLEEF_DISABLE_SSL) set(SLEEF_OPENSSL_FOUND FALSE) endif() @@ -212,17 +212,17 @@ if(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)") set(FLAGS_ENABLE_NEON32 "-mfpu=neon") endif(CMAKE_C_COMPILER_ID MATCHES "GNU") - if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND ENABLE_LTO) - if (NOT LLVM_AR_COMMAND) - find_program(LLVM_AR_COMMAND "llvm-ar") + if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND SLEEF_ENABLE_LTO) + if (NOT SLEEF_LLVM_AR_COMMAND) + find_program(SLEEF_LLVM_AR_COMMAND "llvm-ar") endif() - if (LLVM_AR_COMMAND) - SET(CMAKE_AR ${LLVM_AR_COMMAND}) + if (SLEEF_LLVM_AR_COMMAND) + SET(CMAKE_AR ${SLEEF_LLVM_AR_COMMAND}) SET(CMAKE_C_ARCHIVE_CREATE " rcs ") SET(CMAKE_C_ARCHIVE_FINISH "true") - endif(LLVM_AR_COMMAND) + endif(SLEEF_LLVM_AR_COMMAND) string(CONCAT FLAGS_OTHERS "-flto=thin") - endif(CMAKE_C_COMPILER_ID MATCHES "Clang" AND ENABLE_LTO) + endif(CMAKE_C_COMPILER_ID MATCHES "Clang" AND SLEEF_ENABLE_LTO) # Flags for generating inline headers set(FLAG_PREPROCESS "-E") @@ -323,10 +323,10 @@ endif() # Long double -option(DISABLE_LONG_DOUBLE "Disable long double" OFF) -option(ENFORCE_LONG_DOUBLE "Build fails if long double is not supported by the compiler" OFF) +option(SLEEF_DISABLE_LONG_DOUBLE "Disable long double" OFF) +option(SLEEF_ENFORCE_LONG_DOUBLE "Build fails if long double is not supported by the compiler" OFF) -if(NOT DISABLE_LONG_DOUBLE) +if(NOT SLEEF_DISABLE_LONG_DOUBLE) CHECK_TYPE_SIZE("long double" LD_SIZE) if(LD_SIZE GREATER "9") # This is needed to check since internal compiler error occurs with gcc 4.x @@ -340,16 +340,16 @@ else() message(STATUS "Support for long double disabled by CMake option") endif() -if (ENFORCE_LONG_DOUBLE AND NOT COMPILER_SUPPORTS_LONG_DOUBLE) - message(FATAL_ERROR "ENFORCE_LONG_DOUBLE is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_LONG_DOUBLE AND NOT COMPILER_SUPPORTS_LONG_DOUBLE) + message(FATAL_ERROR "SLEEF_ENFORCE_LONG_DOUBLE is specified and that feature is disabled or not supported by the compiler") endif() # float128 -option(DISABLE_FLOAT128 "Disable float128" OFF) -option(ENFORCE_FLOAT128 "Build fails if float128 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_FLOAT128 "Disable float128" OFF) +option(SLEEF_ENFORCE_FLOAT128 "Build fails if float128 is not supported by the compiler" OFF) -if(NOT DISABLE_FLOAT128) +if(NOT SLEEF_DISABLE_FLOAT128) CHECK_C_SOURCE_COMPILES(" int main() { __float128 r = 1; }" COMPILER_SUPPORTS_FLOAT128) @@ -357,16 +357,16 @@ else() message(STATUS "Support for float128 disabled by CMake option") endif() -if (ENFORCE_FLOAT128 AND NOT COMPILER_SUPPORTS_FLOAT128) - message(FATAL_ERROR "ENFORCE_FLOAT128 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_FLOAT128 AND NOT COMPILER_SUPPORTS_FLOAT128) + message(FATAL_ERROR "SLEEF_ENFORCE_FLOAT128 is specified and that feature is disabled or not supported by the compiler") endif() # SSE2 -option(DISABLE_SSE2 "Disable SSE2" OFF) -option(ENFORCE_SSE2 "Build fails if SSE2 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_SSE2 "Disable SSE2" OFF) +option(SLEEF_ENFORCE_SSE2 "Build fails if SSE2 is not supported by the compiler" OFF) -if(SLEEF_ARCH_X86 AND NOT DISABLE_SSE2) +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_SSE2) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SSE2}") CHECK_C_SOURCE_COMPILES(" #if defined(_MSC_VER) @@ -379,16 +379,16 @@ if(SLEEF_ARCH_X86 AND NOT DISABLE_SSE2) COMPILER_SUPPORTS_SSE2) endif() -if (ENFORCE_SSE2 AND NOT COMPILER_SUPPORTS_SSE2) - message(FATAL_ERROR "ENFORCE_SSE2 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_SSE2 AND NOT COMPILER_SUPPORTS_SSE2) + message(FATAL_ERROR "SLEEF_ENFORCE_SSE2 is specified and that feature is disabled or not supported by the compiler") endif() # SSE 4.1 -option(DISABLE_SSE4 "Disable SSE4" OFF) -option(ENFORCE_SSE4 "Build fails if SSE4 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_SSE4 "Disable SSE4" OFF) +option(SLEEF_ENFORCE_SSE4 "Build fails if SSE4 is not supported by the compiler" OFF) -if(SLEEF_ARCH_X86 AND NOT DISABLE_SSE4) +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_SSE4) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SSE4}") CHECK_C_SOURCE_COMPILES(" #if defined(_MSC_VER) @@ -401,16 +401,16 @@ if(SLEEF_ARCH_X86 AND NOT DISABLE_SSE4) COMPILER_SUPPORTS_SSE4) endif() -if (ENFORCE_SSE4 AND NOT COMPILER_SUPPORTS_SSE4) - message(FATAL_ERROR "ENFORCE_SSE4 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_SSE4 AND NOT COMPILER_SUPPORTS_SSE4) + message(FATAL_ERROR "SLEEF_ENFORCE_SSE4 is specified and that feature is disabled or not supported by the compiler") endif() # AVX -option(ENFORCE_AVX "Disable AVX" OFF) -option(ENFORCE_AVX "Build fails if AVX is not supported by the compiler" OFF) +option(SLEEF_ENFORCE_AVX "Disable AVX" OFF) +option(SLEEF_ENFORCE_AVX "Build fails if AVX is not supported by the compiler" OFF) -if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX) +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_AVX) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX}") CHECK_C_SOURCE_COMPILES(" #if defined(_MSC_VER) @@ -423,16 +423,16 @@ if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX) }" COMPILER_SUPPORTS_AVX) endif() -if (ENFORCE_AVX AND NOT COMPILER_SUPPORTS_AVX) - message(FATAL_ERROR "ENFORCE_AVX is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_AVX AND NOT COMPILER_SUPPORTS_AVX) + message(FATAL_ERROR "SLEEF_ENFORCE_AVX is specified and that feature is disabled or not supported by the compiler") endif() # FMA4 -option(DISABLE_FMA4 "Disable FMA4" OFF) -option(ENFORCE_FMA4 "Build fails if FMA4 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_FMA4 "Disable FMA4" OFF) +option(SLEEF_ENFORCE_FMA4 "Build fails if FMA4 is not supported by the compiler" OFF) -if(SLEEF_ARCH_X86 AND NOT DISABLE_FMA4) +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_FMA4) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_FMA4}") CHECK_C_SOURCE_COMPILES(" #if defined(_MSC_VER) @@ -445,16 +445,16 @@ if(SLEEF_ARCH_X86 AND NOT DISABLE_FMA4) COMPILER_SUPPORTS_FMA4) endif() -if (ENFORCE_FMA4 AND NOT COMPILER_SUPPORTS_FMA4) - message(FATAL_ERROR "ENFORCE_FMA4 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_FMA4 AND NOT COMPILER_SUPPORTS_FMA4) + message(FATAL_ERROR "SLEEF_ENFORCE_FMA4 is specified and that feature is disabled or not supported by the compiler") endif() # AVX2 -option(DISABLE_AVX2 "Disable AVX2" OFF) -option(ENFORCE_AVX2 "Build fails if AVX2 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_AVX2 "Disable AVX2" OFF) +option(SLEEF_ENFORCE_AVX2 "Build fails if AVX2 is not supported by the compiler" OFF) -if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX2) +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_AVX2) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX2}") CHECK_C_SOURCE_COMPILES(" #if defined(_MSC_VER) @@ -472,16 +472,16 @@ if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX2) endif() endif() -if (ENFORCE_AVX2 AND NOT COMPILER_SUPPORTS_AVX2) - message(FATAL_ERROR "ENFORCE_AVX2 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_AVX2 AND NOT COMPILER_SUPPORTS_AVX2) + message(FATAL_ERROR "SLEEF_ENFORCE_AVX2 is specified and that feature is disabled or not supported by the compiler") endif() # AVX512F -option(DISABLE_AVX512F "Disable AVX512F" OFF) -option(ENFORCE_AVX512F "Build fails if AVX512F is not supported by the compiler" OFF) +option(SLEEF_DISABLE_AVX512F "Disable AVX512F" OFF) +option(SLEEF_ENFORCE_AVX512F "Build fails if AVX512F is not supported by the compiler" OFF) -if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX512F) +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_AVX512F) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX512F}") CHECK_C_SOURCE_COMPILES(" #if defined(_MSC_VER) @@ -504,16 +504,16 @@ if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX512F) endif() endif() -if (ENFORCE_AVX512F AND NOT COMPILER_SUPPORTS_AVX512F) - message(FATAL_ERROR "ENFORCE_AVX512F is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_AVX512F AND NOT COMPILER_SUPPORTS_AVX512F) + message(FATAL_ERROR "SLEEF_ENFORCE_AVX512F is specified and that feature is disabled or not supported by the compiler") endif() # SVE -option(DISABLE_SVE "Disable SVE" OFF) -option(ENFORCE_SVE "Build fails if SVE is not supported by the compiler" OFF) +option(SLEEF_DISABLE_SVE "Disable SVE" OFF) +option(SLEEF_ENFORCE_SVE "Build fails if SVE is not supported by the compiler" OFF) -if(SLEEF_ARCH_AARCH64 AND NOT DISABLE_SVE) +if(SLEEF_ARCH_AARCH64 AND NOT SLEEF_DISABLE_SVE) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SVE}") CHECK_C_SOURCE_COMPILES(" #include @@ -526,16 +526,16 @@ if(SLEEF_ARCH_AARCH64 AND NOT DISABLE_SVE) endif() endif() -if (ENFORCE_SVE AND NOT COMPILER_SUPPORTS_SVE) - message(FATAL_ERROR "ENFORCE_SVE is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_SVE AND NOT COMPILER_SUPPORTS_SVE) + message(FATAL_ERROR "SLEEF_ENFORCE_SVE is specified and that feature is disabled or not supported by the compiler") endif() # VSX -option(DISABLE_VSX "Disable VSX" OFF) -option(ENFORCE_VSX "Build fails if VSX is not supported by the compiler" OFF) +option(SLEEF_DISABLE_VSX "Disable VSX" OFF) +option(SLEEF_ENFORCE_VSX "Build fails if VSX is not supported by the compiler" OFF) -if(SLEEF_ARCH_PPC64 AND NOT DISABLE_VSX) +if(SLEEF_ARCH_PPC64 AND NOT SLEEF_DISABLE_VSX) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VSX}") CHECK_C_SOURCE_COMPILES(" #include @@ -556,16 +556,16 @@ if(SLEEF_ARCH_PPC64 AND NOT DISABLE_VSX) endif() endif() -if (ENFORCE_VSX AND NOT COMPILER_SUPPORTS_VSX) - message(FATAL_ERROR "ENFORCE_VSX is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_VSX AND NOT COMPILER_SUPPORTS_VSX) + message(FATAL_ERROR "SLEEF_ENFORCE_VSX is specified and that feature is disabled or not supported by the compiler") endif() # VSX3 -option(DISABLE_VSX3 "Disable VSX3" OFF) -option(ENFORCE_VSX3 "Build fails if VSX3 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_VSX3 "Disable VSX3" OFF) +option(SLEEF_ENFORCE_VSX3 "Build fails if VSX3 is not supported by the compiler" OFF) -if(SLEEF_ARCH_PPC64 AND NOT DISABLE_VSX3) +if(SLEEF_ARCH_PPC64 AND NOT SLEEF_DISABLE_VSX3) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VSX3}") CHECK_C_SOURCE_COMPILES(" #include @@ -585,16 +585,16 @@ if(SLEEF_ARCH_PPC64 AND NOT DISABLE_VSX3) endif() endif() -if (ENFORCE_VSX3 AND NOT COMPILER_SUPPORTS_VSX3) - message(FATAL_ERROR "ENFORCE_VSX3 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_VSX3 AND NOT COMPILER_SUPPORTS_VSX3) + message(FATAL_ERROR "SLEEF_ENFORCE_VSX3 is specified and that feature is disabled or not supported by the compiler") endif() # IBM Z -option(DISABLE_VXE "Disable VXE" OFF) -option(ENFORCE_VXE "Build fails if VXE is not supported by the compiler" OFF) +option(SLEEF_DISABLE_VXE "Disable VXE" OFF) +option(SLEEF_ENFORCE_VXE "Build fails if VXE is not supported by the compiler" OFF) -if(SLEEF_ARCH_S390X AND NOT DISABLE_VXE) +if(SLEEF_ARCH_S390X AND NOT SLEEF_DISABLE_VXE) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VXE}") CHECK_C_SOURCE_COMPILES(" #include @@ -609,16 +609,16 @@ if(SLEEF_ARCH_S390X AND NOT DISABLE_VXE) endif() endif() -if (ENFORCE_VXE AND NOT COMPILER_SUPPORTS_VXE) - message(FATAL_ERROR "ENFORCE_VXE is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_VXE AND NOT COMPILER_SUPPORTS_VXE) + message(FATAL_ERROR "SLEEF_ENFORCE_VXE is specified and that feature is disabled or not supported by the compiler") endif() # -option(DISABLE_VXE2 "Disable VXE2" OFF) -option(ENFORCE_VXE2 "Build fails if VXE2 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_VXE2 "Disable VXE2" OFF) +option(SLEEF_ENFORCE_VXE2 "Build fails if VXE2 is not supported by the compiler" OFF) -if(SLEEF_ARCH_S390X AND NOT DISABLE_VXE2) +if(SLEEF_ARCH_S390X AND NOT SLEEF_DISABLE_VXE2) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VXE2}") CHECK_C_SOURCE_COMPILES(" #include @@ -633,16 +633,16 @@ if(SLEEF_ARCH_S390X AND NOT DISABLE_VXE2) endif() endif() -if (ENFORCE_VXE2 AND NOT COMPILER_SUPPORTS_VXE2) - message(FATAL_ERROR "ENFORCE_VXE2 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_VXE2 AND NOT COMPILER_SUPPORTS_VXE2) + message(FATAL_ERROR "SLEEF_ENFORCE_VXE2 is specified and that feature is disabled or not supported by the compiler") endif() # RVVM1 -option(DISABLE_RVVM1 "Disable RVVM1" OFF) -option(ENFORCE_RVVM1 "Build fails if RVVM1 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_RVVM1 "Disable RVVM1" OFF) +option(SLEEF_ENFORCE_RVVM1 "Build fails if RVVM1 is not supported by the compiler" OFF) -if(SLEEF_ARCH_RISCV64 AND NOT DISABLE_RVVM1) +if(SLEEF_ARCH_RISCV64 AND NOT SLEEF_DISABLE_RVVM1) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_RVVM1}") CHECK_C_SOURCE_COMPILES(" #include @@ -655,16 +655,16 @@ if(SLEEF_ARCH_RISCV64 AND NOT DISABLE_RVVM1) endif() endif() -if (ENFORCE_RVVM1 AND NOT COMPILER_SUPPORTS_RVVM1) - message(FATAL_ERROR "ENFORCE_RVVM1 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_RVVM1 AND NOT COMPILER_SUPPORTS_RVVM1) + message(FATAL_ERROR "SLEEF_ENFORCE_RVVM1 is specified and that feature is disabled or not supported by the compiler") endif() # RVVM2 -option(DISABLE_RVVM2 "Disable RVVM2" OFF) -option(ENFORCE_RVVM2 "Build fails if RVVM2 is not supported by the compiler" OFF) +option(SLEEF_DISABLE_RVVM2 "Disable RVVM2" OFF) +option(SLEEF_ENFORCE_RVVM2 "Build fails if RVVM2 is not supported by the compiler" OFF) -if(SLEEF_ARCH_RISCV64 AND NOT DISABLE_RVVM2) +if(SLEEF_ARCH_RISCV64 AND NOT SLEEF_DISABLE_RVVM2) string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_RVVM2}") CHECK_C_SOURCE_COMPILES(" #include @@ -677,24 +677,24 @@ if(SLEEF_ARCH_RISCV64 AND NOT DISABLE_RVVM2) endif() endif() -if (ENFORCE_RVVM2 AND NOT COMPILER_SUPPORTS_RVVM2) - message(FATAL_ERROR "ENFORCE_RVVM2 is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_RVVM2 AND NOT COMPILER_SUPPORTS_RVVM2) + message(FATAL_ERROR "SLEEF_ENFORCE_RVVM2 is specified and that feature is disabled or not supported by the compiler") endif() # CUDA -option(ENFORCE_CUDA "Build fails if CUDA is not supported" OFF) +option(SLEEF_ENFORCE_CUDA "Build fails if CUDA is not supported" OFF) -if (ENFORCE_CUDA AND NOT CMAKE_CUDA_COMPILER) - message(FATAL_ERROR "ENFORCE_CUDA is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_CUDA AND NOT CMAKE_CUDA_COMPILER) + message(FATAL_ERROR "SLEEF_ENFORCE_CUDA is specified and that feature is disabled or not supported by the compiler") endif() # OpenMP -option(DISABLE_OPENMP "Disable OPENMP" OFF) -option(ENFORCE_OPENMP "Build fails if OPENMP is not supported by the compiler" OFF) +option(SLEEF_DISABLE_OPENMP "Disable OPENMP" OFF) +option(SLEEF_ENFORCE_OPENMP "Build fails if OPENMP is not supported by the compiler" OFF) -if(NOT DISABLE_OPENMP) +if(NOT SLEEF_DISABLE_OPENMP) find_package(OpenMP) # Check if compilation with OpenMP really succeeds # It might not succeed even though find_package(OpenMP) succeeds. @@ -724,8 +724,8 @@ else() message(STATUS "Support for OpenMP disabled by CMake option") endif() -if (ENFORCE_OPENMP AND NOT COMPILER_SUPPORTS_OPENMP) - message(FATAL_ERROR "ENFORCE_OPENMP is specified and that feature is disabled or not supported by the compiler") +if (SLEEF_ENFORCE_OPENMP AND NOT COMPILER_SUPPORTS_OPENMP) + message(FATAL_ERROR "SLEEF_ENFORCE_OPENMP is specified and that feature is disabled or not supported by the compiler") endif() # Weak aliases @@ -748,7 +748,7 @@ if (COMPILER_SUPPORTS_WEAK_ALIASES AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64" AND NOT SLEEF_CLANG_ON_WINDOWS AND - NOT MINGW AND BUILD_GNUABI_LIBS) + NOT MINGW AND SLEEF_BUILD_GNUABI_LIBS) set(ENABLE_GNUABI ${COMPILER_SUPPORTS_WEAK_ALIASES}) endif() diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 3b8a5dc2..a658c76c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -16,8 +16,8 @@ target_link_libraries(hellox86 sleef) # -option(BUILD_DFT_TUTORIAL "Build DFT tutorial" OFF) -if (BUILD_DFT_TUTORIAL) +option(SLEEF_BUILD_DFT_TUTORIAL "Build DFT tutorial" OFF) +if (SLEEF_BUILD_DFT_TUTORIAL) add_executable(dfttutorial tutorial.c) add_dependencies(dfttutorial libsleef) find_library(LIBM m) diff --git a/docs/additional.xhtml b/docs/additional.xhtml index c3f69634..04be1c51 100644 --- a/docs/additional.xhtml +++ b/docs/additional.xhtml @@ -240,7 +240,7 @@ source files.) This can sometimes dramatically improve the performance of the code, because it is capable of fusing library functions into the code calling those functions. The build system in SLEEF supports LTO and thus it can be built with LTO support by just -specifying -DENABLE_LTO=TRUE cmake option. However, there are a +specifying -DSLEEF_ENABLE_LTO=TRUE cmake option. However, there are a few things to note in order to get the optimal performance. 1. You should not use the dispatcher with LTO. Dispatchers prevent the functions from being fused with LTO. 2. You have to use the same @@ -260,7 +260,7 @@ can generate header files in which the library functions are all defined as inline functions. This can be compiled with old compilers. In theory, inline functions should give similar performance to LTO, but in reality, inline functions are better. In order to generate -those header files, specify -DBUILD_INLINE_HEADERS=TRUE cmake +those header files, specify -DSLEEF_BUILD_INLINE_HEADERS=TRUE cmake option. Below is an example code utilizing the generated header files for SSE2 and AVX2. You cannot use a dispatcher with these header files. diff --git a/docs/build-with-cmake.md b/docs/build-with-cmake.md index 9bb09339..2dfaa79e 100644 --- a/docs/build-with-cmake.md +++ b/docs/build-with-cmake.md @@ -134,58 +134,58 @@ optimized, or any other special set of flags. - `SLEEF_SHOW_ERROR_LOG` : Show the content of CMakeError.log - `BUILD_SHARED_LIBS` : Static libs are built if set to FALSE -- `BUILD_GNUABI_LIBS` : Avoid building libraries with GNU ABI if set to FALSE -- `BUILD_INLINE_HEADERS` : Generate header files for inlining whole SLEEF functions +- `SLEEF_BUILD_GNUABI_LIBS` : Avoid building libraries with GNU ABI if set to FALSE +- `SLEEF_BUILD_INLINE_HEADERS` : Generate header files for inlining whole SLEEF functions -- `DISABLE_OPENMP` : Disable support for OpenMP -- `ENFORCE_OPENMP` : Build fails if OpenMP is not supported by the compiler +- `SLEEF_DISABLE_OPENMP` : Disable support for OpenMP +- `SLEEF_ENFORCE_OPENMP` : Build fails if OpenMP is not supported by the compiler -- `ENABLE_LTO` : Enable support for LTO with gcc, or thinLTO with llvm -- `LLVM_AR_COMMAND` : Specify LLVM AR command when you build the library with thinLTO support with clang. +- `SLEEF_ENABLE_LTO` : Enable support for LTO with gcc, or thinLTO with llvm +- `SLEEF_LLVM_AR_COMMAND` : Specify LLVM AR command when you build the library with thinLTO support with clang. - `SLEEF_ENABLE_LLVM_BITCODE` : Generate LLVM bitcode ### Tests -- `BUILD_TESTS` : Avoid building testing tools if set to FALSE -- `ENFORCE_TESTER3` : Build fails if tester3 cannot be built +- `SLEEF_BUILD_TESTS` : Avoid building testing tools if set to FALSE +- `SLEEF_ENFORCE_TESTER3` : Build fails if tester3 cannot be built ### Quad and DFT -- `BUILD_QUAD` : Build quad-precision libraries if set to TRUE -- `BUILD_DFT` : Build DFT libraries if set to TRUE +- `SLEEF_BUILD_QUAD` : Build quad-precision libraries if set to TRUE +- `SLEEF_BUILD_DFT` : Build DFT libraries if set to TRUE - `SLEEFDFT_MAXBUTWIDTH` : This variable specifies the maximum length of combined butterfly block used in the DFT. Setting this value to 7 makes DFT faster but compilation takes more time and the library size will be larger. -- `DISABLE_FFTW` : Disable FFTW-based testing of the DFT library. +- `SLEEF_DISABLE_FFTW` : Disable FFTW-based testing of the DFT library. ### Vector extensions and instructions -- `ENABLE_ALTDIV` : Enable alternative division method (aarch64 only) -- `ENABLE_ALTSQRT` : Enable alternative sqrt method (aarch64 only) -- `DISABLE_LONG_DOUBLE` : Disable support for long double data type -- `ENFORCE_LONG_DOUBLE` : Build fails if long double data type is not supported by the compiler -- `DISABLE_FLOAT128` : Disable support for float128 data type -- `ENFORCE_FLOAT128` : Build fails if float128 data type is not supported by the compiler -- `DISABLE_SSE2` : Disable support for x86 SSE2 -- `ENFORCE_SSE2` : Build fails if SSE2 is not supported by the compiler -- `DISABLE_SSE4` : Disable support for x86 SSE4 -- `ENFORCE_SSE4` : Build fails if SSE4 is not supported by the compiler -- `DISABLE_AVX` : Disable support for x86 AVX -- `ENFORCE_AVX` : Build fails if AVX is not supported by the compiler -- `DISABLE_FMA4` : Disable support for x86 FMA4 -- `ENFORCE_FMA4` : Build fails if FMA4 is not supported by the compiler -- `DISABLE_AVX2` : Disable support for x86 AVX2 -- `ENFORCE_AVX2` : Build fails if AVX2 is not supported by the compiler -- `DISABLE_AVX512F` : Disable support for x86 AVX512F -- `ENFORCE_AVX512F` : Build fails if AVX512F is not supported by the compiler -- `DISABLE_SVE` : Disable support for AArch64 SVE -- `ENFORCE_SVE` : Build fails if SVE is not supported by the compiler -- `DISABLE_VSX` : Disable support for PowerPC VSX -- `ENFORCE_VSX` : Build fails if VSX is not supported by the compiler -- `DISABLE_VSX3` : Disable support for PowerPC VSX-3 -- `ENFORCE_VSX3` : Build fails if VSX-3 is not supported by the compiler -- `DISABLE_VXE` : Disable support for System/390 VXE -- `ENFORCE_VXE` : Build fails if System/390 VXE is not supported by the compiler -- `DISABLE_VXE2` : Disable support for System/390 VXE2 -- `ENFORCE_VXE2` : Build fails if System/390 VXE2 is not supported by the compiler +- `SLEEF_ENABLE_ALTDIV` : Enable alternative division method (aarch64 only) +- `SLEEF_ENABLE_ALTSQRT` : Enable alternative sqrt method (aarch64 only) +- `SLEEF_DISABLE_LONG_DOUBLE` : Disable support for long double data type +- `SLEEF_ENFORCE_LONG_DOUBLE` : Build fails if long double data type is not supported by the compiler +- `SLEEF_DISABLE_FLOAT128` : Disable support for float128 data type +- `SLEEF_ENFORCE_FLOAT128` : Build fails if float128 data type is not supported by the compiler +- `SLEEF_DISABLE_SSE2` : Disable support for x86 SSE2 +- `SLEEF_ENFORCE_SSE2` : Build fails if SSE2 is not supported by the compiler +- `SLEEF_DISABLE_SSE4` : Disable support for x86 SSE4 +- `SLEEF_ENFORCE_SSE4` : Build fails if SSE4 is not supported by the compiler +- `SLEEF_DISABLE_AVX` : Disable support for x86 AVX +- `SLEEF_ENFORCE_AVX` : Build fails if AVX is not supported by the compiler +- `SLEEF_DISABLE_FMA4` : Disable support for x86 FMA4 +- `SLEEF_ENFORCE_FMA4` : Build fails if FMA4 is not supported by the compiler +- `SLEEF_DISABLE_AVX2` : Disable support for x86 AVX2 +- `SLEEF_ENFORCE_AVX2` : Build fails if AVX2 is not supported by the compiler +- `SLEEF_DISABLE_AVX512F` : Disable support for x86 AVX512F +- `SLEEF_ENFORCE_AVX512F` : Build fails if AVX512F is not supported by the compiler +- `SLEEF_DISABLE_SVE` : Disable support for AArch64 SVE +- `SLEEF_ENFORCE_SVE` : Build fails if SVE is not supported by the compiler +- `SLEEF_DISABLE_VSX` : Disable support for PowerPC VSX +- `SLEEF_ENFORCE_VSX` : Build fails if VSX is not supported by the compiler +- `SLEEF_DISABLE_VSX3` : Disable support for PowerPC VSX-3 +- `SLEEF_ENFORCE_VSX3` : Build fails if VSX-3 is not supported by the compiler +- `SLEEF_DISABLE_VXE` : Disable support for System/390 VXE +- `SLEEF_ENFORCE_VXE` : Build fails if System/390 VXE is not supported by the compiler +- `SLEEF_DISABLE_VXE2` : Disable support for System/390 VXE2 +- `SLEEF_ENFORCE_VXE2` : Build fails if System/390 VXE2 is not supported by the compiler diff --git a/docs/compile.xhtml b/docs/compile.xhtml index 6425b0f0..aa56fd32 100644 --- a/docs/compile.xhtml +++ b/docs/compile.xhtml @@ -106,7 +106,7 @@ $ sudo make install with the same version to build the library and other source codes.

-
$ CC=gcc cmake -DBUILD_SHARED_LIBS=FALSE -DENABLE_LTO=TRUE ..
+
$ CC=gcc cmake -DBUILD_SHARED_LIBS=FALSE -DSLEEF_ENABLE_LTO=TRUE ..

In order to build the library with thinLTO support with clang, you @@ -114,7 +114,7 @@ $ sudo make install clang compiler.

-
$ CC=clang-9 cmake -DBUILD_SHARED_LIBS=FALSE -DENABLE_LTO=TRUE -DLLVM_AR_COMMAND=llvm-ar-9 ..
+
$ CC=clang-9 cmake -DBUILD_SHARED_LIBS=FALSE -DSLEEF_ENABLE_LTO=TRUE -DSLEEF_LLVM_AR_COMMAND=llvm-ar-9 ..

Building the header files for inlining the whole SLEEF functions

@@ -128,7 +128,7 @@ $ sudo make install that includes one of these header files.

-
$ cmake -DBUILD_INLINE_HEADERS=TRUE ..
+
$ cmake -DSLEEF_BUILD_INLINE_HEADERS=TRUE ..

Compiling the library with Microsoft Visual C++

@@ -284,7 +284,7 @@ $ ninja $ cd .. $ mkdir build-cross $ cd build-cross -$ cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DNATIVE_BUILD_DIR=`pwd`/../build-native -DDISABLE_MPFR=TRUE -DDISABLE_SSL=TRUE .. +$ cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DNATIVE_BUILD_DIR=`pwd`/../build-native -DSLEEF_DISABLE_MPFR=TRUE -DSLEEF_DISABLE_SSL=TRUE .. $ ninja diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a324340..d5e358f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,21 +2,21 @@ include_directories("common") include_directories("arch") add_subdirectory("libm") -if (BUILD_TESTS) +if (SLEEF_BUILD_TESTS) add_subdirectory("libm-tester") endif() add_subdirectory("common") -if (BUILD_DFT AND NOT MINGW) +if (SLEEF_BUILD_DFT AND NOT MINGW) add_subdirectory("dft") - if (BUILD_TESTS) + if (SLEEF_BUILD_TESTS) add_subdirectory("dft-tester") endif() endif() -if (BUILD_QUAD) +if (SLEEF_BUILD_QUAD) add_subdirectory("quad") - if (BUILD_TESTS) + if (SLEEF_BUILD_TESTS) add_subdirectory("quad-tester") endif() endif() diff --git a/src/arch/helperadvsimd.h b/src/arch/helperadvsimd.h index a4f35504..7647a391 100644 --- a/src/arch/helperadvsimd.h +++ b/src/arch/helperadvsimd.h @@ -195,7 +195,7 @@ static INLINE VECTOR_CC vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) // Reciprocal 1/x, Division, Square root static INLINE VECTOR_CC vfloat vdiv_vf_vf_vf(vfloat n, vfloat d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return vdivq_f32(n, d); #else // Finite numbers (including denormal) only, gives mostly correctly rounded result @@ -216,7 +216,7 @@ static INLINE VECTOR_CC vfloat vdiv_vf_vf_vf(vfloat n, vfloat d) { #endif } static INLINE VECTOR_CC vfloat vrec_vf_vf(vfloat d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return vdiv_vf_vf_vf(vcast_vf_f(1.0f), d); #else return vbslq_f32(vceqq_f32(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)), @@ -225,7 +225,7 @@ static INLINE VECTOR_CC vfloat vrec_vf_vf(vfloat d) { } static INLINE VECTOR_CC vfloat vsqrt_vf_vf(vfloat d) { -#ifndef ENABLE_ALTSQRT +#ifndef SLEEF_ENABLE_ALTSQRT return vsqrtq_f32(d); #else // Gives correctly rounded result for all input range @@ -407,7 +407,7 @@ static INLINE VECTOR_CC vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble // Reciprocal 1/x, Division, Square root static INLINE VECTOR_CC vdouble vdiv_vd_vd_vd(vdouble n, vdouble d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return vdivq_f64(n, d); #else // Finite numbers (including denormal) only, gives mostly correctly rounded result @@ -429,7 +429,7 @@ static INLINE VECTOR_CC vdouble vdiv_vd_vd_vd(vdouble n, vdouble d) { #endif } static INLINE VECTOR_CC vdouble vrec_vd_vd(vdouble d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return vdiv_vd_vd_vd(vcast_vd_d(1.0f), d); #else return vbslq_f64(vceqq_f64(vabs_vd_vd(d), vcast_vd_d(SLEEF_INFINITY)), @@ -438,7 +438,7 @@ static INLINE VECTOR_CC vdouble vrec_vd_vd(vdouble d) { } static INLINE VECTOR_CC vdouble vsqrt_vd_vd(vdouble d) { -#ifndef ENABLE_ALTSQRT +#ifndef SLEEF_ENABLE_ALTSQRT return vsqrtq_f64(d); #else // Gives correctly rounded result for all input range diff --git a/src/arch/helpersve.h b/src/arch/helpersve.h index 9201ae4c..60680075 100644 --- a/src/arch/helpersve.h +++ b/src/arch/helpersve.h @@ -442,7 +442,7 @@ static INLINE vfloat vsel_vf_vo_vf_vf(vopmask mask, vfloat x, vfloat y) { // Reciprocal 1/x, Division, Square root static INLINE vfloat vdiv_vf_vf_vf(vfloat n, vfloat d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return svdiv_f32_x(ptrue, n, d); #else // Finite numbers (including denormal) only, gives mostly correctly rounded result @@ -463,7 +463,7 @@ static INLINE vfloat vdiv_vf_vf_vf(vfloat n, vfloat d) { #endif } static INLINE vfloat vrec_vf_vf(vfloat d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return svdivr_n_f32_x(ptrue, d, 1.0f); #else return vsel_vf_vo_vf_vf(svcmpeq_f32(ptrue, vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)), @@ -471,7 +471,7 @@ static INLINE vfloat vrec_vf_vf(vfloat d) { #endif } static INLINE vfloat vsqrt_vf_vf(vfloat d) { -#ifndef ENABLE_ALTSQRT +#ifndef SLEEF_ENABLE_ALTSQRT return svsqrt_f32_x(ptrue, d); #else // Gives correctly rounded result for all input range @@ -801,7 +801,7 @@ static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, // Reciprocal 1/x, Division, Square root static INLINE vdouble vdiv_vd_vd_vd(vdouble n, vdouble d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return svdiv_f64_x(ptrue, n, d); #else // Finite numbers (including denormal) only, gives mostly correctly rounded result @@ -823,7 +823,7 @@ static INLINE vdouble vdiv_vd_vd_vd(vdouble n, vdouble d) { #endif } static INLINE vdouble vrec_vd_vd(vdouble d) { -#ifndef ENABLE_ALTDIV +#ifndef SLEEF_ENABLE_ALTDIV return svdivr_n_f64_x(ptrue, d, 1.0); #else return vsel_vd_vo_vd_vd(svcmpeq_f64(ptrue, vabs_vd_vd(d), vcast_vd_d(SLEEF_INFINITY)), @@ -831,7 +831,7 @@ static INLINE vdouble vrec_vd_vd(vdouble d) { #endif } static INLINE vdouble vsqrt_vd_vd(vdouble d) { -#ifndef ENABLE_ALTSQRT +#ifndef SLEEF_ENABLE_ALTSQRT return svsqrt_f64_x(ptrue, d); #else // Gives correctly rounded result for all input range diff --git a/src/common/dd.h b/src/common/dd.h index 3431e42d..cc8ed95a 100644 --- a/src/common/dd.h +++ b/src/common/dd.h @@ -4,7 +4,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) -#if !defined(ENABLE_CUDA) +#if !defined(SLEEF_ENABLE_CUDA) typedef struct { vdouble x, y; } vdouble2; @@ -19,7 +19,7 @@ static INLINE CONST VECTOR_CC vdouble2 vd2setx_vd2_vd2_vd(vdouble2 v, vdouble d) static INLINE CONST VECTOR_CC vdouble2 vd2sety_vd2_vd2_vd(vdouble2 v, vdouble d) { v.y = d; return v; } #endif -#if !defined(ENABLE_CUDA) +#if !defined(SLEEF_ENABLE_CUDA) typedef struct { double x, y; } double2; diff --git a/src/common/df.h b/src/common/df.h index a14c1c6a..2224c2d9 100644 --- a/src/common/df.h +++ b/src/common/df.h @@ -4,7 +4,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) -#if !defined(ENABLE_CUDA) +#if !defined(SLEEF_ENABLE_CUDA) typedef struct { vfloat x, y; } vfloat2; diff --git a/src/dft-tester/CMakeLists.txt b/src/dft-tester/CMakeLists.txt index cd48c445..21717b90 100644 --- a/src/dft-tester/CMakeLists.txt +++ b/src/dft-tester/CMakeLists.txt @@ -107,7 +107,7 @@ target_compile_definitions(${TARGET_ROUNDTRIPTEST2DSP} PRIVATE ${COMMON_TARGET_D target_link_libraries(${TARGET_ROUNDTRIPTEST2DSP} ${COMMON_LINK_LIBRARIES}) set_target_properties(${TARGET_ROUNDTRIPTEST2DSP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) -if (LIBFFTW3 AND NOT DISABLE_FFTW) +if (LIBFFTW3 AND NOT SLEEF_DISABLE_FFTW) # Target executable fftwtest1ddp set(TARGET_FFTWTEST1DDP "fftwtest1ddp") add_executable(${TARGET_FFTWTEST1DDP} fftwtest1d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) @@ -161,7 +161,7 @@ if (LIBFFTW3 AND NOT DISABLE_FFTW) add_test_dft(${TARGET_FFTWTEST2DSP}_8_8 $ 8 8) add_test_dft(${TARGET_FFTWTEST2DSP}_10_10 $ 10 10) add_test_dft(${TARGET_FFTWTEST2DSP}_5_15 $ 5 15) -else(LIBFFTW3 AND NOT DISABLE_FFTW) +else(LIBFFTW3 AND NOT SLEEF_DISABLE_FFTW) if(MSVC OR SLEEF_CLANG_ON_WINDOWS) # Test roundtriptestdp add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_1 $ 1 10) @@ -198,4 +198,4 @@ else(LIBFFTW3 AND NOT DISABLE_FFTW) add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_8_8 $ 8 8 10) add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_10_10 $ 10 10 2) add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_5_15 $ 5 15 2) -endif(LIBFFTW3 AND NOT DISABLE_FFTW) +endif(LIBFFTW3 AND NOT SLEEF_DISABLE_FFTW) diff --git a/src/libm-tester/CMakeLists.txt b/src/libm-tester/CMakeLists.txt index a9cd6738..1b5a2a52 100644 --- a/src/libm-tester/CMakeLists.txt +++ b/src/libm-tester/CMakeLists.txt @@ -69,9 +69,9 @@ if(NOT LIB_MPFR) find_program(TESTER_COMMAND tester) endif(NOT LIB_MPFR) -if (ENFORCE_TESTER AND NOT LIB_MPFR AND NOT TESTER_COMMAND) - message(FATAL_ERROR "ENFORCE_TESTER is specified and tester is not available") -endif(ENFORCE_TESTER AND NOT LIB_MPFR AND NOT TESTER_COMMAND) +if (SLEEF_ENFORCE_TESTER AND NOT LIB_MPFR AND NOT TESTER_COMMAND) + message(FATAL_ERROR "SLEEF_ENFORCE_TESTER is specified and tester is not available") +endif(SLEEF_ENFORCE_TESTER AND NOT LIB_MPFR AND NOT TESTER_COMMAND) find_library(LIBRT rt) if (NOT LIBRT) @@ -84,7 +84,7 @@ set(COMMON_TARGET_PROPERTIES C_STANDARD 99 # -std=gnu99 ) -if (ENABLE_LTO) +if (SLEEF_ENABLE_LTO) list(APPEND COMMON_TARGET_PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) # -flto endif() @@ -136,7 +136,7 @@ add_test_iut(${TARGET_IUT} 1.0) set(IUT_LIST ${TARGET_IUT}) # Compile executable 'iutcuda' -if (BUILD_INLINE_HEADERS AND SED_COMMAND AND CMAKE_CUDA_COMPILER) +if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND AND CMAKE_CUDA_COMPILER) add_executable(iutcuda iutcuda.cu) set_target_properties(iutcuda PROPERTIES LINKER_LANGUAGE CUDA) target_compile_options(iutcuda PRIVATE "--fmad=false;-Xcompiler;-ffp-contract=off") @@ -201,7 +201,7 @@ macro(test_extension SIMD) # The iut programs whose names begin with "iuti" are the iut for the # inline version of functions. - if (BUILD_INLINE_HEADERS AND SED_COMMAND) + if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) string(CONCAT IUTINAME "iuti" ${LCSIMD}) add_executable(${IUTINAME} ${IUT_SRC}) target_compile_options(${IUTINAME} PRIVATE ${FLAGS_ENABLE_${SIMD}}) @@ -221,7 +221,7 @@ macro(test_extension SIMD) add_test_iut(${IUTINAME} 1.0) endif() list(APPEND IUT_LIST ${IUTINAME}) - endif(BUILD_INLINE_HEADERS AND SED_COMMAND) + endif(SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) if(LIB_MPFR AND NOT ${SIMD} STREQUAL NEON32 AND NOT ${SIMD} STREQUAL NEON32VFPV4 AND NOT MINGW) # Build tester2 SIMD @@ -410,7 +410,7 @@ if (SLEEF_ARCH_S390X) list(APPEND IUT_LIST iutdsp128) endif(SLEEF_ARCH_S390X) -if(BUILD_SCALAR_LIB) +if(SLEEF_BUILD_SCALAR_LIB) # Compile executable 'iutscalar' add_executable(iutscalar iut.c testerutil.c) target_compile_definitions(iutscalar PRIVATE ${COMMON_TARGET_DEFINITIONS}) diff --git a/src/libm/CMakeLists.txt b/src/libm/CMakeLists.txt index 26ac4e3d..25e11775 100644 --- a/src/libm/CMakeLists.txt +++ b/src/libm/CMakeLists.txt @@ -352,7 +352,7 @@ if (BUILD_SHARED_LIBS) list(APPEND COMMON_TARGET_PROPERTIES POSITION_INDEPENDENT_CODE ON) # -fPIC endif() -if (ENABLE_LTO) +if (SLEEF_ENABLE_LTO) list(APPEND COMMON_TARGET_PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) # -flto endif() @@ -402,14 +402,14 @@ foreach(SIMD ${SLEEF_SUPPORTED_LIBM_EXTENSIONS}) target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE ENABLE_BUILTIN_MATH=1) endif() - if(ENABLE_ALTDIV) - target_compile_definitions(${OBJECT_${SIMD}} PRIVATE ENABLE_ALTDIV=1) - target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE ENABLE_ALTDIV=1) + if(SLEEF_ENABLE_ALTDIV) + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE SLEEF_ENABLE_ALTDIV=1) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE SLEEF_ENABLE_ALTDIV=1) endif() - if(ENABLE_ALTSQRT) - target_compile_definitions(${OBJECT_${SIMD}} PRIVATE ENABLE_ALTSQRT=1) - target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE ENABLE_ALTSQRT=1) + if(SLEEF_ENABLE_ALTSQRT) + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE SLEEF_ENABLE_ALTSQRT=1) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE SLEEF_ENABLE_ALTSQRT=1) endif() if (INDEX_ALIAS EQUAL -1) @@ -485,9 +485,9 @@ endforeach() # -if(BUILD_INLINE_HEADERS) +if(SLEEF_BUILD_INLINE_HEADERS) if(CMAKE_C_COMPILER_ID MATCHES "Intel") - message(FATAL_ERROR "BUILD_INLINE_HEADERS is not supported with Intel Compiler") + message(FATAL_ERROR "SLEEF_BUILD_INLINE_HEADERS is not supported with Intel Compiler") endif() file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/) @@ -662,7 +662,7 @@ if(BUILD_INLINE_HEADERS) INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) endif(SED_COMMAND) -endif(BUILD_INLINE_HEADERS) +endif(SLEEF_BUILD_INLINE_HEADERS) # On some systems we need to explicitly link libsleef against libm to # use some of the math functions used in the scalar code (for example @@ -856,12 +856,12 @@ if(ENABLE_GNUABI) ) endif() - if(ENABLE_ALTDIV) - target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE ENABLE_ALTDIV=1) + if(SLEEF_ENABLE_ALTDIV) + target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE SLEEF_ENABLE_ALTDIV=1) endif() - if(ENABLE_ALTSQRT) - target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE ENABLE_ALTSQRT=1) + if(SLEEF_ENABLE_ALTSQRT) + target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE SLEEF_ENABLE_ALTSQRT=1) endif() set_target_properties(${OBJECT_${SIMD}_${T}_GNUABI} PROPERTIES @@ -990,7 +990,7 @@ if(COMPILER_SUPPORTS_BUILTIN_MATH) target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1) endif() -if(BUILD_SCALAR_LIB) +if(SLEEF_BUILD_SCALAR_LIB) install( TARGETS sleefscalar EXPORT sleefTargets diff --git a/src/libm/sleefsimddp.c b/src/libm/sleefsimddp.c index 6cdaa6ad..d8d17a70 100644 --- a/src/libm/sleefsimddp.c +++ b/src/libm/sleefsimddp.c @@ -15,7 +15,7 @@ #include "quaddef.h" #include "misc.h" -#ifndef ENABLE_CUDA +#ifndef SLEEF_ENABLE_CUDA extern const double Sleef_rempitabdp[]; #endif @@ -308,7 +308,7 @@ extern const double Sleef_rempitabdp[]; #endif #endif -#ifdef ENABLE_CUDA +#ifdef SLEEF_ENABLE_CUDA #define CONFIG 3 #include "helperpurec_scalar.h" #ifdef DORENAME diff --git a/src/libm/sleefsimdsp.c b/src/libm/sleefsimdsp.c index c5dbc2a5..27bfda0f 100644 --- a/src/libm/sleefsimdsp.c +++ b/src/libm/sleefsimdsp.c @@ -15,7 +15,7 @@ #include "quaddef.h" #include "misc.h" -#ifndef ENABLE_CUDA +#ifndef SLEEF_ENABLE_CUDA extern const float Sleef_rempitabsp[]; #endif @@ -420,7 +420,7 @@ extern const float Sleef_rempitabsp[]; #endif #endif -#ifdef ENABLE_CUDA +#ifdef SLEEF_ENABLE_CUDA #define CONFIG 3 #if !defined(SLEEF_GENHEADER) #include "helperpurec_scalar.h" diff --git a/src/quad-tester/CMakeLists.txt b/src/quad-tester/CMakeLists.txt index 96a47587..66e30642 100644 --- a/src/quad-tester/CMakeLists.txt +++ b/src/quad-tester/CMakeLists.txt @@ -107,7 +107,7 @@ macro(test_extension SIMD) # The iut programs whose names begin with "qiuti" are the iut for the # inline version of quad functions. - if (BUILD_INLINE_HEADERS AND SED_COMMAND) + if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) if (MSVC AND NOT SLEEF_CLANG_ON_WINDOWS) message(STATUS "Quad inline headers are not tested with MSVC") else() @@ -133,7 +133,7 @@ macro(test_extension SIMD) endif() list(APPEND IUT_LIST ${IUTINAME}) endif() - endif(BUILD_INLINE_HEADERS AND SED_COMMAND) + endif(SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) if(LIB_MPFR AND NOT MINGW) # Build qtester2 SIMD @@ -219,7 +219,7 @@ endif() # Compile executable 'qiutcuda' -if (BUILD_INLINE_HEADERS AND SED_COMMAND AND CMAKE_CUDA_COMPILER) +if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND AND CMAKE_CUDA_COMPILER) add_executable(qiutcuda qiutcuda.cu) set_target_properties(qiutcuda PROPERTIES LINKER_LANGUAGE CUDA) target_compile_options(qiutcuda PRIVATE "--fmad=false;-Xcompiler;-ffp-contract=off") diff --git a/src/quad/CMakeLists.txt b/src/quad/CMakeLists.txt index bbf155b6..ee996268 100644 --- a/src/quad/CMakeLists.txt +++ b/src/quad/CMakeLists.txt @@ -221,9 +221,9 @@ endif() # Inline headers # -------------------------------------------------------------------- -if(BUILD_INLINE_HEADERS) +if(SLEEF_BUILD_INLINE_HEADERS) if(CMAKE_C_COMPILER_ID MATCHES "Intel") - message(FATAL_ERROR "BUILD_INLINE_HEADERS is not supported with Intel Compiler") + message(FATAL_ERROR "SLEEF_BUILD_INLINE_HEADERS is not supported with Intel Compiler") endif() file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/) @@ -372,7 +372,7 @@ if(BUILD_INLINE_HEADERS) COMPONENT sleef_Development ) endif(SED_COMMAND) -endif(BUILD_INLINE_HEADERS) +endif(SLEEF_BUILD_INLINE_HEADERS) # -------------------------------------------------------------------- diff --git a/src/quad/sleefsimdqp.c b/src/quad/sleefsimdqp.c index e3c1eb06..db4bba95 100644 --- a/src/quad/sleefsimdqp.c +++ b/src/quad/sleefsimdqp.c @@ -15,7 +15,7 @@ #include "quaddef.h" #include "misc.h" -#ifndef ENABLE_CUDA +#ifndef SLEEF_ENABLE_CUDA extern const double Sleef_rempitabqp[]; #endif @@ -47,7 +47,7 @@ extern const double Sleef_rempitabqp[]; #endif #endif -#ifdef ENABLE_CUDA +#ifdef SLEEF_ENABLE_CUDA #define CONFIG 3 #include "helperpurec_scalar.h" #ifdef DORENAME @@ -716,7 +716,7 @@ static INLINE CONST VECTOR_CC vdouble2 poly27dd(vdouble2 x, vdouble c26, double2 // -#ifndef ENABLE_CUDA +#ifndef SLEEF_ENABLE_CUDA typedef struct { double x, y, z; } double3; @@ -3188,7 +3188,7 @@ EXPORT CONST VECTOR_CC vargquad xldexpq(vargquad aa, vint e) { #ifndef ENABLE_SVE -#ifndef ENABLE_CUDA +#ifndef SLEEF_ENABLE_CUDA #define EXPORT2 EXPORT #define CONST2 CONST #else