On Thu, Jun 20, 2024 at 5:01 PM Daniel P. Berrangé <berra...@redhat.com> wrote: > > config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \ > > + .enable_auto_if(get_option('x86_version') >= '3') \ > > .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot > > enable AVX2') \ > > .require(cc.links(''' > > #include <cpuid.h> > > @@ -2875,6 +2876,7 @@ config_host_data.set('CONFIG_AVX2_OPT', > > get_option('avx2') \ > > '''), error_message: 'AVX2 not available').allowed()) > > > > config_host_data.set('CONFIG_AVX512BW_OPT', get_option('avx512bw') \ > > + .enable_auto_if(get_option('x86_version') >= '4') \ > > .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot > > enable AVX512BW') \ > > .require(cc.links(''' > > #include <cpuid.h> > > I'm not sure this makes sense. The CONFIG_AVX* options are used only > to validate whether the toolchain has support for this. The QEMU > code then has a runtime, so it automagically uses AVX2/AVX512 > if-and-only-if running on a suitably new CPU. IOW, we want this > enabled always when the toolchain supports it, regardless of what > x86_version is set.
The difference is that if the toolchain does not support AVX2/AVX512 intrinsics for some reason, and you require -Dx86_version={3,4}, meson would report an error with this patch. Paolo