Skip to content

[mph] fix pext algorithm when BMI2 is not available #9

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

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

jason7708
Copy link
Contributor

I added a condition where, if the gaps between the mask bits are too small, the pext calculation will be done using a for loop.
The downside is that if a, which is the key, is a runtime variable, calculating pext will require running the for loop if the mask doesn't support the multiply trick.

As for the approach of ensuring that incorrect pext values are unique when selecting masks, I don't think it's a good solution.
It alters the method for selecting unique values and leads to an inconsistency where, with -mbmi2, the pext function supports all masks, but without it, it only supports specific masks.
Also, it makes mask selection more difficult and increases space usage. However, it avoids running a for loop when dealing with runtime variables.

I believe this is a decision that needs to be made by you.

@kris-jusiak kris-jusiak merged commit 6f51c3d into qlibs:main Sep 24, 2024
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.

2 participants