Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
-
cross-platform, gcc, clang, msvc, amd64
Description
The pclmul acceleration for the zlib crc32() function that was cleaned up in MDEV-22641 is not available on Windows, because the code is using GCC-style inline assembler. Intel intrinsics should be used.
Attachments
Issue Links
- blocks
-
MDEV-19935 Create unified CRC-32 interface
-
- Closed
-
-
MDEV-33817 Implement AVX512BW and VPCLMULQDQ based CRC-32 algorithms
-
- Closed
-
- causes
-
MDEV-23680 Assertion `data' failed in crcr32_calc_pclmulqdq
-
- Closed
-
-
MDEV-24745 Fallback CRC-32C computation wrongly uses SSE4.1 instructions
-
- Closed
-
- is blocked by
-
MDEV-22641 Provide SIMD optimized wrapper for zlib crc32()
-
- Closed
-
I would prefer to see something like this in the implementation. The approach was demonstrated in
MDEV-20386. For GCC 4, we must work around broken header files.#include <wmmintrin.h>
#ifdef __GNUC__
#endif
{
__m128i a,b,c;
…
c=_mm_clmulepi64_si128 (a,b,1);
…
}
For GCC 4 (the oldest that we currently support is 4.8.2), some extra hoops are needed to replace the broken #include header:
#include <string.h>
#include <stdint.h>
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 5
# define _mm_clmulepi64_si128 __builtin_ia32_pclmulqdq128
#else
# include <wmmintrin.h>
#endif
#ifdef __GNUC__
#endif
{
__m128i a,b,c;
c=_mm_clmulepi64_si128 (a,b,1);
}
I would find it risky to compile the entire compilation unit with something that enables many SIMD features that may not be available on the least common denominator (SSE2 for AMD64; Intel 80486 or possibly something newer for IA-32). We do not want the compiler to accidentally enable some exotic instructions for any ‘glue’ code that is supposed to run anywhere.