summaryrefslogtreecommitdiff
path: root/absl/crc/internal/crc_x86_arm_combined.cc
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2022-11-23 11:38:14 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2022-11-23 11:38:58 -0800
commitc2e9ce1d07116432c64fbc2f4e0328d387ad6a1c (patch)
tree1e42b45b55bf645d7b5480d681a571ef560715d5 /absl/crc/internal/crc_x86_arm_combined.cc
parent4c5eb49d6aababb86d35a40c1a606b11c5bb554f (diff)
CRC: Get CPU detection and hardware acceleration working on MSVC x86(_64)
Using /arch:AVX on MSVC now uses the accelerated implementation PiperOrigin-RevId: 490550573 Change-Id: I924259845f38ee41d15f23f95ad085ad664642b5
Diffstat (limited to 'absl/crc/internal/crc_x86_arm_combined.cc')
-rw-r--r--absl/crc/internal/crc_x86_arm_combined.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/absl/crc/internal/crc_x86_arm_combined.cc b/absl/crc/internal/crc_x86_arm_combined.cc
index 06f9c69c..d771a786 100644
--- a/absl/crc/internal/crc_x86_arm_combined.cc
+++ b/absl/crc/internal/crc_x86_arm_combined.cc
@@ -35,6 +35,9 @@
#define ABSL_INTERNAL_CAN_USE_SIMD_CRC32C
#elif defined(__SSE4_2__) && defined(__PCLMUL__)
#define ABSL_INTERNAL_CAN_USE_SIMD_CRC32C
+#elif defined(_MSC_VER) && defined(__AVX__)
+// MSVC AVX support (/arch:AVX) implies SSE 4.2 and PCLMUL support.
+#define ABSL_INTERNAL_CAN_USE_SIMD_CRC32C
#endif
namespace absl {