Skip to content

[x86 / Refactor] BMI2 check changed to BMI1 for !305

Summary

This merge request fixes a minor mistake in the new ANDN optimisation in !305 (merged) where flags for BMI2 was checked instead of BMI1 (which introduced ANDN).

System

  • Processor architecture: i386, x86_64

What is the current bug behavior?

Before attempting to apply the ANDN optimisation, BMI2 is checked for instead of BMI1.

What is the behavior after applying this patch?

BMI1 is correctly checked instead of BMI2

Additional notes

Intel introduced BMI1 and BMI2 at the same time with the Haswell processors, which are enabled with -CpCOREAVX2. BMI1 was only introduced alone on AMD processors. Ultimately the mistake doesn't cause any bad or unsupported code to be generated, since even if a processor were introduced that supported only BMI1 and not BMI2, the only symptom is ANDN code not being generated.

Edited by J. Gareth "Kit" Moreton

Merge request reports