The 64-bit 'and' with immediate instruction only supports a 32-bit immediate. So for larger constants we have to load the constant into a register first. If the immediate happens to be a mask we can use the BEXTRI instruction to perform the masking. We already do something similar using the BZHI instruction from the BMI2 instruction set.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Nice - useful for BMI1 as well do you think? Would use a second register like the AND case but requires a smaller immediate and would allow more load folding opportunities.