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

Check bit 28 for AVX support #55

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

Lynnesbian
Copy link
Contributor

When checking for AVX support on x86 platforms, the code currently looks at bit 27 twice:

faster-hex/src/lib.rs

Lines 95 to 97 in a7ce51f

let have_xsave = (proc_info_ecx >> 26) & 1 == 1;
let have_osxsave = (proc_info_ecx >> 27) & 1 == 1;
let have_avx = (proc_info_ecx >> 27) & 1 == 1;

Wikipedia's CPUID article states that the avx flag is in bit 28. This pull request changes the code to check bit 28 for AVX support instead of bit 27.

I ensured that all tests passed before committing.

@eval-exec
Copy link
Collaborator

Thank you, please also invite @elichai to review this pull request.

@eval-exec
Copy link
Collaborator

I think this PR is ready to merge.

@zhangsoledad zhangsoledad added this pull request to the merge queue Sep 23, 2024
Merged via the queue into nervosnetwork:master with commit cc0da4a Sep 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants