Commits


Antoine Pitrou authored and GitHub committed 50015f08484
GH-37017: [C++] Guard unexpected uses of BMI2 instructions (#37610) ### Rationale for this change Some functions introduced with Acero only check for AVX2 availability, but they actually invoke BMI2 instructions. This can have two negative consequences: * compiling BMI2 intrinsics may fail because BMI2 was not explicitly enabled on the compiler (gh-37017) * some rare CPUs (Via CPUs perhaps) may support AVX2 but not BMI2; other CPUs by AMD have a very inefficient implementation of some BMI2 instructions ### What changes are included in this PR? 1. Ensure that the suitable compiler flag is passed when compiling code with BMI2 intrinsics 2. Make sure the CPU supports BMI2 adequately before invoking functions featuring BMI2 instructions ### Are these changes tested? Yes, assuming CI covers enough diversity of target platforms. ### Are there any user-facing changes? No, but performance might change (positively or negatively) depending on the CPU and platform. * Closes: #37017 Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>