mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 01:49:41 +00:00
Fix use of <x86intrin.h> for MSVC (GH #1198)
It seems Microsoft now defines GCC defines, like __BMI__
This commit is contained in:
parent
f5f63850f9
commit
ddb8f36e88
@ -33,11 +33,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
#if (CRYPTOPP_SSE41_AVAILABLE)
|
||||
# include <emmintrin.h>
|
||||
|
@ -43,11 +43,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
#if (CRYPTOPP_SSE41_AVAILABLE)
|
||||
# include <emmintrin.h>
|
||||
|
@ -45,11 +45,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
#if (CRYPTOPP_ARM_NEON_HEADER)
|
||||
# include <arm_neon.h>
|
||||
|
@ -23,11 +23,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
// Clang intrinsic casts, http://bugs.llvm.org/show_bug.cgi?id=20670
|
||||
#define DOUBLE_CAST(x) ((double*)(void*)(x))
|
||||
|
@ -87,4 +87,10 @@
|
||||
# define CRYPTOPP_MSC_VERSION (_MSC_VER)
|
||||
#endif
|
||||
|
||||
// To control <x86intrin.h> include. May need a guard, like GCC 4.5 and above
|
||||
// Also see https://stackoverflow.com/a/42493893 and https://github.com/weidai11/cryptopp/issues/1198
|
||||
#if defined(CRYPTOPP_GCC_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) || defined(CRYPTOPP_LLVM_CLANG_VERSION)
|
||||
# define CRYPTOPP_GCC_COMPATIBLE 1
|
||||
#endif
|
||||
|
||||
#endif // CRYPTOPP_CONFIG_VERSION_H
|
||||
|
@ -27,11 +27,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
// Squash MS LNK4221 and libtool warnings
|
||||
extern const char KECCAK_SIMD_FNAME[] = __FILE__;
|
||||
|
@ -23,11 +23,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
#if (CRYPTOPP_ARM_NEON_HEADER)
|
||||
# include "adv_simd.h"
|
||||
|
@ -25,8 +25,7 @@ extern const char LSH256_AVX_FNAME[] = __FILE__;
|
||||
# include <immintrin.h>
|
||||
#endif
|
||||
|
||||
// GCC at 4.5. Clang is unknown. Also see https://stackoverflow.com/a/42493893.
|
||||
#if (CRYPTOPP_GCC_VERSION >= 40500)
|
||||
#if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
|
@ -30,8 +30,7 @@ extern const char LSH256_SSE_FNAME[] = __FILE__;
|
||||
# include <ammintrin.h>
|
||||
#endif
|
||||
|
||||
// GCC at 4.5. Clang is unknown. Also see https://stackoverflow.com/a/42493893.
|
||||
#if (CRYPTOPP_GCC_VERSION >= 40500)
|
||||
#if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
|
@ -25,8 +25,7 @@ extern const char LSH512_AVX_FNAME[] = __FILE__;
|
||||
# include <immintrin.h>
|
||||
#endif
|
||||
|
||||
// GCC at 4.5. Clang is unknown. Also see https://stackoverflow.com/a/42493893.
|
||||
#if (CRYPTOPP_GCC_VERSION >= 40500)
|
||||
#if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
|
@ -29,8 +29,7 @@ extern const char LSH512_SSE_FNAME[] = __FILE__;
|
||||
# include <ammintrin.h>
|
||||
#endif
|
||||
|
||||
// GCC at 4.5. Clang is unknown. Also see https://stackoverflow.com/a/42493893.
|
||||
#if (CRYPTOPP_GCC_VERSION >= 40500)
|
||||
#if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
|
6
misc.h
6
misc.h
@ -80,9 +80,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__BMI__)
|
||||
# include <x86intrin.h>
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
# include <immintrin.h>
|
||||
#endif // GCC and BMI
|
||||
#endif // BMI
|
||||
|
||||
// More LLVM bullshit. Apple Clang 6.0 does not define them.
|
||||
// Later version of Clang defines them and results in warnings.
|
||||
|
@ -23,11 +23,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
#if (CRYPTOPP_ARM_NEON_HEADER)
|
||||
# include "adv_simd.h"
|
||||
|
@ -23,11 +23,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(__XOP__)
|
||||
# include <ammintrin.h>
|
||||
# if defined(__GNUC__)
|
||||
# if defined(CRYPTOPP_GCC_COMPATIBLE)
|
||||
# include <x86intrin.h>
|
||||
# endif
|
||||
#endif
|
||||
# include <ammintrin.h>
|
||||
#endif // XOP
|
||||
|
||||
#if (CRYPTOPP_ARM_NEON_HEADER)
|
||||
# include "adv_simd.h"
|
||||
|
Loading…
Reference in New Issue
Block a user