Skip to content

Commit

Permalink
lib/x86/crc32_impl: avoid build error with gcc 8.1 and gcc 8.2
Browse files Browse the repository at this point in the history
Resolves #371
  • Loading branch information
ebiggers committed May 7, 2024
1 parent 0e88d7e commit b03254d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/x86/crc32_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ static const u8 MAYBE_UNUSED shift_tab[48] = {
* Currently this can't be enabled with MSVC because MSVC has a bug where it
* incorrectly assumes that VPCLMULQDQ implies AVX-512:
* https://developercommunity.visualstudio.com/t/Compiler-incorrectly-assumes-VAES-and-VP/10578785
*
* gcc 8.1 and 8.2 had a similar bug where they assumed that
* _mm256_clmulepi64_epi128() always needed AVX512. It's fixed in gcc 8.3.
*/
#if GCC_PREREQ(8, 1) || CLANG_PREREQ(6, 0, 10000000)
#if GCC_PREREQ(8, 3) || CLANG_PREREQ(6, 0, 10000000)
# define crc32_x86_vpclmulqdq_avx2 crc32_x86_vpclmulqdq_avx2
# define SUFFIX _vpclmulqdq_avx2
# define ATTRIBUTES _target_attribute("vpclmulqdq,pclmul,avx2")
Expand Down

0 comments on commit b03254d

Please sign in to comment.