Skip to content

[x86 / Refactor] More consistent check for BMI2 in integer division code generator

Summary

This merge request makes an internal check for BMI2 more consistent with the rest of the compiler, specifically when generating reciprocal instructions for integer divisions. Before:

if (current_settings.cputype = cpu_core_avx2) then

After:

IF (CPUX86_HAS_BMI2 in cpu_capabilities[current_settings.cputype]) then

This matches the design used for when the compiler decides to use SHLX and SHRX, and also removes a potentially phantom bug if a new Intel chipset is introduced (i.e. the cputype is no longer cpu_core_avx2 but something newer).

System

  • Operating system: i386, x86_64

What is the current bug behavior?

N/A

What is the behavior after applying this patch?

N/A

Merge request reports