]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
Add -mbmi to AVX2 and AVX512 compile flags develop
authorNathan Moin Vaziri <nathan@nathanm.com>
Thu, 11 Jun 2026 23:38:57 +0000 (16:38 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 13 Jun 2026 10:03:26 +0000 (12:03 +0200)
commitbd6b67944486855e944e00e5a1cbaafd828e52b2
treefd7196863d25f83ea9e6b490b46b8bfd963191e9
parentbd3333159ae6e2a5375c472d2bb3dbc66b6539f5
Add -mbmi to AVX2 and AVX512 compile flags

The AVX2 and AVX512 flags enable BMI2 but not BMI1, and TZCNT is a
BMI1 instruction. GCC emits the rep bsf encoding that executes as
TZCNT on BMI hardware regardless, but clang gates on the feature bit
and emits plain BSF, which is slower on AMD. Every CPU with AVX2 also
has BMI1, so the flag only affects code already behind AVX2 runtime
detection.

Assisted-By: Claude Opus 4.8 (1M context)
cmake/detect-intrinsics.cmake
configure