Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BMI2 detection in 32-bit mode #4251

Merged
merged 1 commit into from
Jan 19, 2025
Merged

BMI2 detection in 32-bit mode #4251

merged 1 commit into from
Jan 19, 2025

Conversation

Cyan4973
Copy link
Contributor

Following the fix #4248,
bmi2 mode is no longer limited to x64 64-bit mode.

Consequently, this patch makes it possible to automatically detect and use this instruction set at compilation time, even when the target is 32-bit.

This makes it possible to use this instruction set in 32-bit mode, resulting in significant speed gains, notably on the decompression side.

Decompression speed benchmark, measured on a i7-9700k, ubuntu 24.04, gcc 13.3.0:

dataset -m32 -m32 -mavx2 -mbmi2 difference
silesia.tar 861 MB/s 948 MB/s +10.1 %
calgary.tar 836 MB/s 915 MB/s +9.4 %
enwik7 752 MB/s 822 MB/s +9.3%

Also: updated library documentation, to feature STATIC_BMI2 build variable

this was previously no triggered in x86 32-bit mode,
due to a limitation in `bitstream.h`, that was fixed in #4248.

Now, `bmi2` will be automatically detected and triggered
at compilation time, if the corresponding instruction set is enabled,
even in 32-bit mode.

Also: updated library documentation, to feature STATIC_BMI2 build variable
@Cyan4973 Cyan4973 self-assigned this Jan 19, 2025
@Cyan4973 Cyan4973 merged commit 9fbed33 into dev Jan 19, 2025
96 checks passed
@Cyan4973 Cyan4973 mentioned this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants