Commit 669184b4 by Stan Hu Committed by GitHub

Include immintrin.h instead of wmmintrin.h (#1015)

immintrin.h is the de-factor standard header for clang and GCC to
include Intel intrinsics. Using this header avoids requiring the
compiler to use the `-maes` and `-msse4.1` compiler options on systems
that may not have AES or SSE instruction support.

clang: As seen in
https://github.com/llvm-mirror/clang/blob/master/lib/Headers/immintrin.h,
specific intrinsic header files are conditionally included depending on
whether the feature is available.

gcc: As seen in
https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/immintrin.h,
gcc includes all intrinsic header files, but each individual file guards
against the feature not being available.

This came out of an investigation in
https://github.com/grpc/grpc/pull/27121.
parent cfbf5bf9
...@@ -211,7 +211,7 @@ inline ABSL_TARGET_CRYPTO void SwapEndian(void*) {} ...@@ -211,7 +211,7 @@ inline ABSL_TARGET_CRYPTO void SwapEndian(void*) {}
#elif defined(ABSL_ARCH_X86_64) || defined(ABSL_ARCH_X86_32) #elif defined(ABSL_ARCH_X86_64) || defined(ABSL_ARCH_X86_32)
// On x86 we rely on the aesni instructions // On x86 we rely on the aesni instructions
#include <wmmintrin.h> #include <immintrin.h>
namespace { namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment