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

Test or remove BMI code from AVX2 backend #577

Closed
1 of 5 tasks
hanno-becker opened this issue Dec 24, 2024 · 3 comments · Fixed by #578 or #591
Closed
1 of 5 tasks

Test or remove BMI code from AVX2 backend #577

hanno-becker opened this issue Dec 24, 2024 · 3 comments · Fixed by #578 or #591

Comments

@hanno-becker
Copy link
Contributor

The AVX2 rejection sampling code inherited from the official Kyber implementation some ifdef's regarding the availability of bit manipulation instructions. Those are untested at present.

Remove all code guarded by BMI, or (a) test it, (b) evaluate the range of targets where this is available, and (c) show that it actually helps performance (if it does).

For now I am inclined to just remove it. We cannot have untested code in the library.

Platform:
Which platform does this concern?

  • platform independent
  • aarch64
  • x86_64
  • rv64
  • other
@hanno-becker hanno-becker added enhancement New feature or request testing x86_64 labels Dec 24, 2024
@hanno-becker
Copy link
Contributor Author

@dkostic Can you comment on this by chance?

@dkostic
Copy link

dkostic commented Dec 24, 2024

Hi Hanno, I agree that it'd be best to remove the code. Although the flag says BMI, the code actually uses BMI2 instructions. Since Haswell, Intel has both BMI and BMI2; but AMD has processors that support BMI but don't support BMI2 (see here for details https://en.wikipedia.org/wiki/X86_Bit_manipulation_instruction_set).

@hanno-becker
Copy link
Contributor Author

@mkannwischer Do you have time to take care of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants