Skip to content

x86: Require AVX support for bit compress/expand #7813

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Spencer-Comin
Copy link
Contributor

AVX support is required to generate VEX prefix for pext and pdep instructions.

AVX support is required to generate VEX prefix for pext and pdep instructions.

Signed-off-by: Spencer Comin <[email protected]>
Copy link
Contributor

@BradleyWood BradleyWood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not well documented if VEX encoded BMI2 instructions can run when AVX is not supported, but either way, binary encoding will not behave correctly in this case.

I also found a similar issue with FMA opcodes used in OpenJ9, which I will fix.

@0xdaryl 0xdaryl self-assigned this Jun 27, 2025
@0xdaryl
Copy link
Contributor

0xdaryl commented Jun 27, 2025

Sorry, what is the motivation for this PR? Is it because our current binary encoder won't let you encode VEX instructions unless AVX is supported, or is it just defensive programming?

My understanding is that from the processor's perspective, AVX is not a necessary pre-req for BMI2.

@Spencer-Comin
Copy link
Contributor Author

Our current binary encoder won't let you encode VEX instructions unless AVX is supported. There aren't any physical processors that I'm aware of with BMI2 but not AVX. As far as BIOS/hypervisor disabling AVX while requiring BMI2, theoretically this could happen, but I imagine that happens rarely enough (never?) that we won't run into a situation where not having bitwise compress/expand support even when it's technically supported becomes a problem.

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.

3 participants