[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/6] configure: Provide option to explicitly disable
From: |
Thomas Huth |
Subject: |
[Qemu-devel] [PULL 6/6] configure: Provide option to explicitly disable AVX2 |
Date: |
Wed, 24 Oct 2018 10:52:08 +0100 |
From: Liam Merwick <address@hidden>
The configure script detects if the compiler has AVX2 support and
automatically sets avx2_opt="yes" which in turn defines CONFIG_AVX2_OPT.
There is no way of explicitly overriding this setting so this commit adds
two command-line options: --enable-avx2 and --disable-avx2.
The default behaviour, when no option is specified, is to maintain the
current behaviour and enable AVX2 if the compiler supports it.
Signed-off-by: Liam Merwick <address@hidden>
Reviewed-by: Darren Kenny <address@hidden>
Reviewed-by: Mark Kanda <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
---
configure | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index e39f63d..1ee09bd 100755
--- a/configure
+++ b/configure
@@ -428,7 +428,7 @@ usb_redir=""
opengl=""
opengl_dmabuf="no"
cpuid_h="no"
-avx2_opt="no"
+avx2_opt=""
zlib="yes"
capstone=""
lzo=""
@@ -1329,6 +1329,10 @@ for opt do
;;
--disable-glusterfs) glusterfs="no"
;;
+ --disable-avx2) avx2_opt="no"
+ ;;
+ --enable-avx2) avx2_opt="yes"
+ ;;
--enable-glusterfs) glusterfs="yes"
;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
@@ -1703,6 +1707,7 @@ disabled with --disable-FEATURE, default is enabled if
available:
libxml2 for Parallels image format
tcmalloc tcmalloc support
jemalloc jemalloc support
+ avx2 AVX2 optimization support
replication replication support
vhost-vsock virtio sockets device support
opengl opengl support
@@ -5032,7 +5037,7 @@ fi
# 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; then
+if test "$cpuid_h" = "yes" -a "$avx2_opt" != "no"; then
cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx2")
@@ -5046,6 +5051,8 @@ int main(int argc, char *argv[]) { return bar(argv[0]); }
EOF
if compile_object "" ; then
avx2_opt="yes"
+ else
+ avx2_opt="no"
fi
fi
--
1.8.3.1
- [Qemu-devel] [PULL 0/6] qtest, Makefiles and shell script improvements, Thomas Huth, 2018/10/24
- [Qemu-devel] [PULL 1/6] tests/migration-test: Disable s390x test when running with TCG, Thomas Huth, 2018/10/24
- [Qemu-devel] [PULL 2/6] hw/core: Move null-machine into the common-obj list, Thomas Huth, 2018/10/24
- [Qemu-devel] [PULL 3/6] configs: Add a CONFIG_SMC37C669 switch for the "smc37c669-superio" device, Thomas Huth, 2018/10/24
- [Qemu-devel] [PULL 4/6] debian-bootstrap.pre: Modern shell scripting (use $() instead of ``), Thomas Huth, 2018/10/24
- [Qemu-devel] [PULL 5/6] po/Makefile: Modern shell scripting (use $() instead of ``), Thomas Huth, 2018/10/24
- [Qemu-devel] [PULL 6/6] configure: Provide option to explicitly disable AVX2,
Thomas Huth <=
- Re: [Qemu-devel] [PULL 0/6] qtest, Makefiles and shell script improvements, Peter Maydell, 2018/10/24