trace_backends="log"
trace_file="trace"
opengl="$default_feature"
-cpuid_h="no"
-avx2_opt="$default_feature"
guest_agent="$default_feature"
vss_win32_sdk="$default_feature"
win_sdk="no"
;;
--disable-tools) want_tools="no"
;;
- --disable-avx2) avx2_opt="no"
- ;;
- --enable-avx2) avx2_opt="yes"
- ;;
- --disable-avx512f) avx512f_opt="no"
- ;;
- --enable-avx512f) avx512f_opt="yes"
- ;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2
;;
coroutine-pool coroutine freelist (better performance)
tpm TPM support
numa libnuma support
- avx2 AVX2 optimization support
- avx512f AVX512F optimization support
replication replication support
opengl opengl support
qom-cast-debug cast debugging support
fi
fi
-########################################
-# check if cpuid.h is usable.
-
-cat > $TMPC << EOF
-#include <cpuid.h>
-int main(void) {
- unsigned a, b, c, d;
- unsigned max = __get_cpuid_max(0, 0);
-
- if (max >= 1) {
- __cpuid(1, a, b, c, d);
- }
-
- if (max >= 7) {
- __cpuid_count(7, 0, a, b, c, d);
- }
-
- return 0;
-}
-EOF
-if compile_prog "" "" ; then
- cpuid_h=yes
-fi
-
-##########################################
-# avx2 optimization requirement check
-#
-# There is no point enabling this if cpuid.h is not usable,
-# since we won't be able to select the new routines.
-
-if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then
- cat > $TMPC << EOF
-#pragma GCC push_options
-#pragma GCC target("avx2")
-#include <cpuid.h>
-#include <immintrin.h>
-static int bar(void *a) {
- __m256i x = *(__m256i *)a;
- return _mm256_testz_si256(x, x);
-}
-int main(int argc, char *argv[]) { return bar(argv[0]); }
-EOF
- if compile_object "-Werror" ; then
- avx2_opt="yes"
- else
- avx2_opt="no"
- fi
-fi
-
-##########################################
-# avx512f optimization requirement check
-#
-# There is no point enabling this if cpuid.h is not usable,
-# since we won't be able to select the new routines.
-# by default, it is turned off.
-# if user explicitly want to enable it, check environment
-
-if test "$cpuid_h" = "yes" && test "$avx512f_opt" = "yes"; then
- cat > $TMPC << EOF
-#pragma GCC push_options
-#pragma GCC target("avx512f")
-#include <cpuid.h>
-#include <immintrin.h>
-static int bar(void *a) {
- __m512i x = *(__m512i *)a;
- return _mm512_test_epi64_mask(x, x);
-}
-int main(int argc, char *argv[])
-{
- return bar(argv[0]);
-}
-EOF
- if ! compile_object "-Werror" ; then
- avx512f_opt="no"
- fi
-else
- avx512f_opt="no"
-fi
-
########################################
# check if __[u]int128_t is usable.
echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
fi
-if test "$avx2_opt" = "yes" ; then
- echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
-fi
-
-if test "$avx512f_opt" = "yes" ; then
- echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak
-fi
-
# XXX: suppress that
if [ "$bsd" = "yes" ] ; then
echo "CONFIG_BSD=y" >> $config_host_mak
echo "CONFIG_TSAN=y" >> $config_host_mak
fi
-if test "$cpuid_h" = "yes" ; then
- echo "CONFIG_CPUID_H=y" >> $config_host_mak
-fi
-
if test "$int128" = "yes" ; then
echo "CONFIG_INT128=y" >> $config_host_mak
fi
return getauxval(AT_HWCAP) == 0;
}'''))
+have_cpuid_h = cc.links('''
+ #include <cpuid.h>
+ int main(void) {
+ unsigned a, b, c, d;
+ unsigned max = __get_cpuid_max(0, 0);
+
+ if (max >= 1) {
+ __cpuid(1, a, b, c, d);
+ }
+
+ if (max >= 7) {
+ __cpuid_count(7, 0, a, b, c, d);
+ }
+
+ return 0;
+ }''')
+config_host_data.set('CONFIG_CPUID_H', have_cpuid_h)
+
+config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \
+ .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX2') \
+ .require(cc.links('''
+ #pragma GCC push_options
+ #pragma GCC target("avx2")
+ #include <cpuid.h>
+ #include <immintrin.h>
+ static int bar(void *a) {
+ __m256i x = *(__m256i *)a;
+ return _mm256_testz_si256(x, x);
+ }
+ int main(int argc, char *argv[]) { return bar(argv[0]); }
+ '''), error_message: 'AVX2 not available').allowed())
+
+config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \
+ .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX512F') \
+ .require(cc.links('''
+ #pragma GCC push_options
+ #pragma GCC target("avx512f")
+ #include <cpuid.h>
+ #include <immintrin.h>
+ static int bar(void *a) {
+ __m512i x = *(__m512i *)a;
+ return _mm512_test_epi64_mask(x, x);
+ }
+ int main(int argc, char *argv[]) { return bar(argv[0]); }
+ '''), error_message: 'AVX512F not available').allowed())
+
config_host_data.set('CONFIG_AF_VSOCK', cc.compiles(gnu_source_prefix + '''
#include <errno.h>
#include <sys/types.h>
summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')}
summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')}
summary_info += {'memory allocator': get_option('malloc')}
-summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')}
-summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')}
+summary_info += {'avx2 optimization': config_host_data.get('CONFIG_AVX2_OPT')}
+summary_info += {'avx512f optimization': config_host_data.get('CONFIG_AVX512F_OPT')}
summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
summary_info += {'gcov': get_option('b_coverage')}
summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')}
description: 'Out of process device emulation support')
option('dbus_display', type: 'feature', value: 'auto',
description: '-display dbus support')
+option('avx2', type: 'feature', value: 'auto',
+ description: 'AVX2 optimizations')
+option('avx512f', type: 'feature', value: 'disabled',
+ description: 'AVX512F optimizations')
option('attr', type : 'feature', value : 'auto',
description: 'attr/xattr support')
printf "%s\n" ' alsa ALSA sound support'
printf "%s\n" ' attr attr/xattr support'
printf "%s\n" ' auth-pam PAM access control'
+ printf "%s\n" ' avx2 AVX2 optimizations'
+ printf "%s\n" ' avx512f AVX512F optimizations'
printf "%s\n" ' bpf eBPF support'
printf "%s\n" ' brlapi brlapi character device driver'
printf "%s\n" ' bzip2 bzip2 support for DMG images'
--disable-attr) printf "%s" -Dattr=disabled ;;
--enable-auth-pam) printf "%s" -Dauth_pam=enabled ;;
--disable-auth-pam) printf "%s" -Dauth_pam=disabled ;;
+ --enable-avx2) printf "%s" -Davx2=enabled ;;
+ --disable-avx2) printf "%s" -Davx2=disabled ;;
+ --enable-avx512f) printf "%s" -Davx512f=enabled ;;
+ --disable-avx512f) printf "%s" -Davx512f=disabled ;;
--enable-bpf) printf "%s" -Dbpf=enabled ;;
--disable-bpf) printf "%s" -Dbpf=disabled ;;
--enable-brlapi) printf "%s" -Dbrlapi=enabled ;;