aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-01-09 12:22:05 +0200
committerLasse Collin <lasse.collin@tukaani.org>2023-01-09 16:58:27 +0200
commite96dee55df04113c33b387ccdb6cb70935422d91 (patch)
treeb5e3c846b0deebc0902c57a4f24be8037753aac1 /src
parentBuild: Require that _mm_set_epi64x() is usable to enable CLMUL support. (diff)
downloadxz-e96dee55df04113c33b387ccdb6cb70935422d91.tar.xz
liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022).
I haven't tested with MSVC myself and there doesn't seem to be information about the problem online, so I'm relying on the bug report. Thanks to Iouri Kharon for the bug report and the patch.
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/check/crc64_fast.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/liblzma/check/crc64_fast.c b/src/liblzma/check/crc64_fast.c
index e3cbf1b1..1df0963e 100644
--- a/src/liblzma/check/crc64_fast.c
+++ b/src/liblzma/check/crc64_fast.c
@@ -279,6 +279,12 @@ crc64_clmul(const uint8_t *buf, size_t size, uint64_t crc)
const __m128i initial_crc = _mm_cvtsi64_si128(~crc);
#endif
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \
+ && defined(_M_IX86)
+ // Workaround for MSVC when compiling for 32-bit x86:
+ __asm mov ebx, ebx ; force store ebx: VS2015-2022 destroy it :(
+#endif
+
__m128i v0, v1, v2, v3;
#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS