diff --git a/Eigen/src/Core/arch/NEON/Complex.h b/Eigen/src/Core/arch/NEON/Complex.h index 1445c6246..7855e4e8b 100644 --- a/Eigen/src/Core/arch/NEON/Complex.h +++ b/Eigen/src/Core/arch/NEON/Complex.h @@ -461,7 +461,7 @@ EIGEN_INSTANTIATE_COMPLEX_MATH_FUNCS(Packet1cf) EIGEN_INSTANTIATE_COMPLEX_MATH_FUNCS(Packet2cf) //---------- double ---------- -#if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG +#if EIGEN_ARCH_ARM64 inline uint64x2_t p2ul_CONJ_XOR() { static const uint64_t p2ul_conj_XOR_DATA[] = {0x0, 0x8000000000000000}; diff --git a/Eigen/src/Core/arch/NEON/MathFunctions.h b/Eigen/src/Core/arch/NEON/MathFunctions.h index ed421821e..1e947af33 100644 --- a/Eigen/src/Core/arch/NEON/MathFunctions.h +++ b/Eigen/src/Core/arch/NEON/MathFunctions.h @@ -52,7 +52,7 @@ EIGEN_STRONG_INLINE Packet4bf pldexp(const Packet4bf& a, const Packet4bf& expone //---------- double ---------- -#if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG +#if EIGEN_ARCH_ARM64 EIGEN_INSTANTIATE_GENERIC_MATH_FUNCS_DOUBLE(Packet2d) diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h index 79f44d5d1..f0309882e 100644 --- a/Eigen/src/Core/arch/NEON/PacketMath.h +++ b/Eigen/src/Core/arch/NEON/PacketMath.h @@ -4955,18 +4955,7 @@ EIGEN_STRONG_INLINE Packet4bf pnegate(const Packet4bf& a) { //---------- double ---------- -// Clang 3.5 in the iOS toolchain has an ICE triggered by NEON intrinsics for double. -// Confirmed at least with __apple_build_version__ = 6000054. -#if EIGEN_COMP_CLANGAPPLE -// Let's hope that by the time __apple_build_version__ hits the 601* range, the bug will be fixed. -// https://gist.github.com/yamaya/2924292 suggests that the 3 first digits are only updated with -// major toolchain updates. -#define EIGEN_APPLE_DOUBLE_NEON_BUG (EIGEN_COMP_CLANGAPPLE < 6010000) -#else -#define EIGEN_APPLE_DOUBLE_NEON_BUG 0 -#endif - -#if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG +#if EIGEN_ARCH_ARM64 #if EIGEN_COMP_GNUC // Bug 907: workaround missing declarations of the following two functions in the ADK @@ -5043,7 +5032,7 @@ struct packet_traits : default_packet_traits { HasDiv = 1, -#if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG +#if EIGEN_ARCH_ARM64 HasExp = 1, HasLog = 1, HasLog10 = 1, @@ -5390,7 +5379,7 @@ EIGEN_STRONG_INLINE Packet2d psqrt(const Packet2d& _x) { return vsqrtq_f64(_x); } -#endif // EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG +#endif // EIGEN_ARCH_ARM64 // Do we have an fp16 types and supporting Neon intrinsics? #if EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC diff --git a/Eigen/src/Core/util/Assert.h b/Eigen/src/Core/util/Assert.h index 07c4f43a1..22a87e140 100644 --- a/Eigen/src/Core/util/Assert.h +++ b/Eigen/src/Core/util/Assert.h @@ -41,13 +41,13 @@ #ifndef EIGEN_HAS_BUILTIN_FILE // Clang can check if __builtin_FILE() is supported. -// GCC > 5, MSVC 2019 14.26 (1926) all have __builtin_FILE(). +// Supported GCC versions and MSVC 2019 14.26 (1926) all have __builtin_FILE(). // // For NVCC, it's more complicated. Through trial-and-error: // - nvcc+gcc supports __builtin_FILE() on host, and on device after CUDA 11. // - nvcc+msvc supports __builtin_FILE() only after CUDA 11. -#if (EIGEN_HAS_BUILTIN(__builtin_FILE) && (EIGEN_COMP_CLANG || !defined(EIGEN_CUDA_ARCH))) || \ - (EIGEN_GNUC_STRICT_AT_LEAST(5, 0, 0) && (EIGEN_COMP_NVCC >= 110000 || !defined(EIGEN_CUDA_ARCH))) || \ +#if (EIGEN_HAS_BUILTIN(__builtin_FILE) && (EIGEN_COMP_CLANG || !defined(EIGEN_CUDA_ARCH))) || \ + (EIGEN_COMP_GNUC_STRICT && (EIGEN_COMP_NVCC >= 110000 || !defined(EIGEN_CUDA_ARCH))) || \ (EIGEN_COMP_MSVC >= 1926 && (!EIGEN_COMP_NVCC || EIGEN_COMP_NVCC >= 110000)) #define EIGEN_HAS_BUILTIN_FILE 1 #else diff --git a/Eigen/src/Core/util/ConfigureVectorization.h b/Eigen/src/Core/util/ConfigureVectorization.h index 7ea2b3c77..87e7fad59 100644 --- a/Eigen/src/Core/util/ConfigureVectorization.h +++ b/Eigen/src/Core/util/ConfigureVectorization.h @@ -360,9 +360,8 @@ // so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too. // notice that since these are C headers, the extern "C" is theoretically needed anyways. extern "C" { -// In theory we should only include immintrin.h and not the other *mmintrin.h header files directly. -// Doing so triggers some issues with ICC. However old gcc versions may not have this file, thus: -#if EIGEN_COMP_ICC >= 1110 || EIGEN_COMP_EMSCRIPTEN +// ICC and Emscripten need the umbrella header instead of direct *mmintrin.h includes. +#if EIGEN_COMP_ICC || EIGEN_COMP_EMSCRIPTEN #include #else #include @@ -525,7 +524,7 @@ extern "C" { #define EIGEN_VECTORIZE_FMA #endif -#if defined(__F16C__) && !defined(EIGEN_GPUCC) && (!EIGEN_COMP_CLANG_STRICT || EIGEN_CLANG_STRICT_AT_LEAST(3, 8, 0)) +#if defined(__F16C__) && !defined(EIGEN_GPUCC) // We can use the optimized fp16 to float and float to fp16 conversion routines #define EIGEN_HAS_FP16_C diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index f9776a5de..87cd6242b 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -734,7 +734,7 @@ // supported by Eigen do not define _MSVC_LANG, so use Eigen's minimum standard. #if EIGEN_COMP_MSVC_LANG > 0 #define EIGEN_CPLUSPLUS EIGEN_COMP_MSVC_LANG -#elif EIGEN_COMP_MSVC >= 1900 +#elif EIGEN_COMP_MSVC #define EIGEN_CPLUSPLUS 201402L #elif defined(__cplusplus) #define EIGEN_CPLUSPLUS __cplusplus @@ -809,8 +809,8 @@ // See https://gitlab.com/libeigen/eigen/-/issues/2575 // Does the compiler support C++17 if constexpr? #ifndef EIGEN_HAS_CXX17_IFCONSTEXPR -#if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17 && \ - ((EIGEN_COMP_MSVC >= 1911) || (EIGEN_GNUC_STRICT_AT_LEAST(7, 0, 0)) || (EIGEN_CLANG_STRICT_AT_LEAST(3, 9, 0)) || \ +#if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17 && \ + ((EIGEN_COMP_MSVC >= 1911) || (EIGEN_GNUC_STRICT_AT_LEAST(7, 0, 0)) || EIGEN_COMP_CLANG_STRICT || \ (EIGEN_COMP_CLANGAPPLE && EIGEN_COMP_CLANGAPPLE >= 10000000)) #define EIGEN_HAS_CXX17_IFCONSTEXPR 1 #endif diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index cb7f1e3ef..d1066d0f5 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -64,8 +64,7 @@ // set_is_malloc_allowed() function. #ifndef EIGEN_AVOID_THREAD_LOCAL -#if ((EIGEN_COMP_GNUC) || __has_feature(cxx_thread_local) || EIGEN_COMP_MSVC >= 1900) && \ - !defined(EIGEN_GPU_COMPILE_PHASE) +#if !defined(EIGEN_GPU_COMPILE_PHASE) #define EIGEN_MALLOC_CHECK_THREAD_LOCAL thread_local #else #define EIGEN_MALLOC_CHECK_THREAD_LOCAL diff --git a/Eigen/src/LU/arch/InverseSize4.h b/Eigen/src/LU/arch/InverseSize4.h index 94c80429b..f32915bd9 100644 --- a/Eigen/src/LU/arch/InverseSize4.h +++ b/Eigen/src/LU/arch/InverseSize4.h @@ -166,7 +166,7 @@ struct compute_inverse_size4 diff --git a/Eigen/src/ThreadPool/ThreadLocal.h b/Eigen/src/ThreadPool/ThreadLocal.h index e2b35621f..4ba7cea59 100644 --- a/Eigen/src/ThreadPool/ThreadLocal.h +++ b/Eigen/src/ThreadPool/ThreadLocal.h @@ -19,22 +19,18 @@ #else -#if ((EIGEN_COMP_GNUC) || __has_feature(cxx_thread_local) || EIGEN_COMP_MSVC) #define EIGEN_THREAD_LOCAL static thread_local -#endif // Disable TLS for Apple and Android builds with older toolchains. #if defined(__APPLE__) // Included for TARGET_OS_IPHONE, __IPHONE_OS_VERSION_MIN_REQUIRED, -// __IPHONE_8_0. +// __IPHONE_9_0. #include #include #endif // Checks whether the `thread_local` storage duration specifier is supported. -#if EIGEN_COMP_CLANGAPPLE && \ - ((EIGEN_COMP_CLANGAPPLE < 8000042) || (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)) -// Notes: Xcode's clang did not support `thread_local` until version -// 8, and even then not for all iOS < 9.0. +#if EIGEN_COMP_CLANGAPPLE && TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 +// Notes: `thread_local` is not supported for all iOS < 9.0. #undef EIGEN_THREAD_LOCAL #elif defined(__ANDROID__) && EIGEN_COMP_CLANG diff --git a/test/fastmath.cpp b/test/fastmath.cpp index 334f84a55..deec4966b 100644 --- a/test/fastmath.cpp +++ b/test/fastmath.cpp @@ -18,23 +18,6 @@ void check(bool b, bool ref) { std::cout << " BAD "; } -#if EIGEN_COMP_MSVC && EIGEN_COMP_MSVC < 1800 -namespace std { -template -bool(isfinite)(T x) { - return _finite(x); -} -template -bool(isnan)(T x) { - return _isnan(x); -} -template -bool(isinf)(T x) { - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -} -} // namespace std -#endif - template void check_inf_nan(bool dryrun) { Matrix m(10);