mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 19:24:48 +02:00
changed detection of Intel Compiler Classic to distinguish MS-Windows (#2510)
* changed detection of Intel Compiler Classic to distinguish MS-Windows * replaced !FMT_ICC_ON_WINDOWS by FMT_ICC_POSIX removed #pragma manged * replaced FMT_ICC_POSIX with FMT_ICC_INTRINSIC_BUG to be crystal clear about the macro's purpose
This commit is contained in:
@@ -32,10 +32,15 @@
|
|||||||
# define FMT_GCC_PRAGMA(arg)
|
# define FMT_GCC_PRAGMA(arg)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER)
|
#ifdef __ICL
|
||||||
|
# define FMT_ICC_VERSION __ICL
|
||||||
|
# define FMT_ICC_INTRINSIC_BUG 1
|
||||||
|
#elif defined(__INTEL_COMPILER)
|
||||||
# define FMT_ICC_VERSION __INTEL_COMPILER
|
# define FMT_ICC_VERSION __INTEL_COMPILER
|
||||||
|
# define FMT_ICC_INTRINSIC_BUG 0
|
||||||
#else
|
#else
|
||||||
# define FMT_ICC_VERSION 0
|
# define FMT_ICC_VERSION 0
|
||||||
|
# define FMT_ICC_INTRINSIC_BUG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __NVCC__
|
#ifdef __NVCC__
|
||||||
|
@@ -49,14 +49,6 @@
|
|||||||
# define FMT_GCC_VISIBILITY_HIDDEN
|
# define FMT_GCC_VISIBILITY_HIDDEN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
|
||||||
# define FMT_ICC_VERSION __INTEL_COMPILER
|
|
||||||
#elif defined(__ICL)
|
|
||||||
# define FMT_ICC_VERSION __ICL
|
|
||||||
#else
|
|
||||||
# define FMT_ICC_VERSION 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __NVCC__
|
#ifdef __NVCC__
|
||||||
# define FMT_CUDA_VERSION (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__)
|
# define FMT_CUDA_VERSION (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__)
|
||||||
#else
|
#else
|
||||||
@@ -173,10 +165,13 @@ FMT_END_NAMESPACE
|
|||||||
!FMT_MSC_VER
|
!FMT_MSC_VER
|
||||||
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
||||||
#endif
|
#endif
|
||||||
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz) || FMT_ICC_VERSION)
|
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz) || FMT_ICC_VERSION) && \
|
||||||
|
!FMT_ICC_INTRINSIC_BUG
|
||||||
# define FMT_BUILTIN_CTZ(n) __builtin_ctz(n)
|
# define FMT_BUILTIN_CTZ(n) __builtin_ctz(n)
|
||||||
#endif
|
#endif
|
||||||
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll) || FMT_ICC_VERSION)
|
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll) || \
|
||||||
|
FMT_ICC_VERSION) && \
|
||||||
|
!FMT_ICC_INTRINSIC_BUG
|
||||||
# define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n)
|
# define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -192,7 +187,6 @@ FMT_BEGIN_NAMESPACE
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning.
|
// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning.
|
||||||
# if !defined(__clang__)
|
# if !defined(__clang__)
|
||||||
# pragma managed(push, off)
|
|
||||||
# pragma intrinsic(_BitScanForward)
|
# pragma intrinsic(_BitScanForward)
|
||||||
# pragma intrinsic(_BitScanReverse)
|
# pragma intrinsic(_BitScanReverse)
|
||||||
# if defined(_WIN64)
|
# if defined(_WIN64)
|
||||||
@@ -254,9 +248,6 @@ inline auto ctzll(uint64_t x) -> int {
|
|||||||
return static_cast<int>(r);
|
return static_cast<int>(r);
|
||||||
}
|
}
|
||||||
# define FMT_BUILTIN_CTZLL(n) detail::ctzll(n)
|
# define FMT_BUILTIN_CTZLL(n) detail::ctzll(n)
|
||||||
# if !defined(__clang__)
|
|
||||||
# pragma managed(pop)
|
|
||||||
# endif
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user