diff options
author | Derek Mauro <dmauro@google.com> | 2023-01-05 16:42:37 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-01-05 23:06:37 -0800 |
commit | 625a18016d6208c6c0419697cb6caa3f23ce31bc (patch) | |
tree | 85e21b7012000963c946ea8c9d58d982aed20667 /absl/crc/internal/crc_memcpy.h | |
parent | 05109783621601b680cf33217edde6a8e484327b (diff) |
Require 64-bit builds on x86 to use AcceleratedCrcMemcpyEngine
This also ensures that there is only one definition of
GetArchSpecificEngines by moving the condition to a common place.
PiperOrigin-RevId: 500038304
Change-Id: If0c55d701dfdc11a1a9c8c1b34eb220435529ffb
Diffstat (limited to 'absl/crc/internal/crc_memcpy.h')
-rw-r--r-- | absl/crc/internal/crc_memcpy.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/crc/internal/crc_memcpy.h b/absl/crc/internal/crc_memcpy.h index ae9cccad..4909d433 100644 --- a/absl/crc/internal/crc_memcpy.h +++ b/absl/crc/internal/crc_memcpy.h @@ -21,6 +21,13 @@ #include "absl/base/config.h" #include "absl/crc/crc32c.h" +// Defined if the class AcceleratedCrcMemcpyEngine exists. +#if defined(__x86_64__) && defined(__SSE4_2__) +#define ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE 1 +#elif defined(_MSC_VER) && defined(__AVX__) +#define ABSL_INTERNAL_HAVE_X86_64_ACCELERATED_CRC_MEMCPY_ENGINE 1 +#endif + namespace absl { ABSL_NAMESPACE_BEGIN namespace crc_internal { |