juce::SystemStats::hasAVX2() not working on my machine

hi,

My CPU (i7-4980HQ CPU @ 2.80GHz) is supposed to support AVX2, as reported by OSX sysctl

sysctl -a | grep machdep.cpu.leaf7_features

machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID FPU_CSDS

but juce::SystemStats::hasAVX2() returns false on my machine.

Here is a related bug report from chrome, if it can help
https://bugs.chromium.org/p/chromium/issues/detail?id=630077

It would also be great to have hasAVX512(), hasFMA()… etc for finer CPU features detection.

thanks! I tested your commit and AVX2 is detected as expected

1 Like