Skip to content

Commit

Permalink
lib/x86: increase AVX-VNNI gcc prerequisite to 12.1
Browse files Browse the repository at this point in the history
Although gcc 11.1 supports AVX-VNNI, a popular distro pairs it with a
binutils version that does not.  Require gcc 12 instead.

Resolves #365
  • Loading branch information
ebiggers committed Apr 4, 2024
1 parent 618bfc5 commit 857c97a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/x86/adler32_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@
/*
* AVX-VNNI implementation. This is used on CPUs that have AVX2 and AVX-VNNI
* but don't have AVX-512, for example Intel Alder Lake.
*
* Unusually for a new CPU feature, gcc added support for the AVX-VNNI
* intrinsics (in gcc 11.1) slightly before binutils added support for
* assembling AVX-VNNI instructions (in binutils 2.36). Distros can reasonably
* have gcc 11 with binutils 2.35. Because of this issue, we check for gcc 12
* instead of gcc 11. (libdeflate supports direct compilation without a
* configure step, so checking the binutils version is not always an option.)
*/
#if GCC_PREREQ(11, 1) || CLANG_PREREQ(12, 0, 13000000) || MSVC_PREREQ(1930)
#if GCC_PREREQ(12, 1) || CLANG_PREREQ(12, 0, 13000000) || MSVC_PREREQ(1930)
# define adler32_x86_avx2_vnni adler32_x86_avx2_vnni
# define SUFFIX _avx2_vnni
# define ATTRIBUTES _target_attribute("avx2,avxvnni")
Expand Down

0 comments on commit 857c97a

Please sign in to comment.