[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 4/5] configure: detect ifunc and avx2 attribute
From: |
Amit Shah |
Subject: |
[Qemu-devel] [PULL 4/5] configure: detect ifunc and avx2 attribute |
Date: |
Tue, 23 Feb 2016 13:00:54 +0530 |
From: Liang Li <address@hidden>
Detect if the compiler can support the ifun and avx2, if so, set
CONFIG_AVX2_OPT which will be used to turn on the avx2 instruction
optimization.
Suggested-by: Paolo Bonzini <address@hidden>
Suggested-by: Peter Maydell <address@hidden>
Signed-off-by: Liang Li <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>
---
configure | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/configure b/configure
index 0aa249b..d508f10 100755
--- a/configure
+++ b/configure
@@ -279,6 +279,7 @@ smartcard=""
libusb=""
usb_redir=""
opengl=""
+avx2_opt="no"
zlib="yes"
lzo=""
snappy=""
@@ -1772,6 +1773,21 @@ EOF
fi
##########################################
+# avx2 optimization requirement check
+
+cat > $TMPC << EOF
+static void bar(void) {}
+static void *bar_ifunc(void) {return (void*) bar;}
+static void foo(void) __attribute__((ifunc("bar_ifunc")));
+int main(void) { foo(); return 0; }
+EOF
+if compile_prog "-mavx2" "" ; then
+ if readelf --syms $TMPE |grep "IFUNC.*foo" >/dev/null 2>&1; then
+ avx2_opt="yes"
+ fi
+fi
+
+#########################################
# zlib check
if test "$zlib" != "no" ; then
@@ -4776,6 +4792,7 @@ echo "bzip2 support $bzip2"
echo "NUMA host support $numa"
echo "tcmalloc support $tcmalloc"
echo "jemalloc support $jemalloc"
+echo "avx2 optimization $avx2_opt"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -5160,6 +5177,10 @@ if test "$opengl" = "yes" ; then
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 "$lzo" = "yes" ; then
echo "CONFIG_LZO=y" >> $config_host_mak
fi
--
2.5.0
- [Qemu-devel] [PULL 0/5] migration pull, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 1/5] migration: move bdrv_invalidate_cache_all of of coroutine context, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 2/5] migration: move bdrv_invalidate_cache_all of of coroutine context, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 3/5] migration: reorder code to make it symmetric, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 4/5] configure: detect ifunc and avx2 attribute,
Amit Shah <=
- [Qemu-devel] [PULL 5/5] cutils: add avx2 instruction optimization, Amit Shah, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Peter Maydell, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Amit Shah, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Paolo Bonzini, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Peter Maydell, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Li, Liang Z, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Peter Maydell, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Paolo Bonzini, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Li, Liang Z, 2016/02/24
Re: [Qemu-devel] [PULL 0/5] migration pull, Li, Liang Z, 2016/02/23