diff options
author | Stan Hu <stanhu@gmail.com> | 2021-09-13 17:05:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 20:05:29 -0400 |
commit | 669184b4f33421037dae51f87a15794198566295 (patch) | |
tree | 5ced7752a53f9946b7b20c74d06d5a6bed4ce6a9 | |
parent | cfbf5bf948a2656bda7ddab59d3bcb29595c144c (diff) |
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.
-rw-r--r-- | absl/random/internal/randen_hwaes.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/random/internal/randen_hwaes.cc b/absl/random/internal/randen_hwaes.cc index 3040b3a7..fee6677c 100644 --- a/absl/random/internal/randen_hwaes.cc +++ b/absl/random/internal/randen_hwaes.cc @@ -211,7 +211,7 @@ inline ABSL_TARGET_CRYPTO void SwapEndian(void*) {} #elif defined(ABSL_ARCH_X86_64) || defined(ABSL_ARCH_X86_32) // On x86 we rely on the aesni instructions -#include <wmmintrin.h> +#include <immintrin.h> namespace { |