aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-03-09 01:07:16 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-03-09 01:07:16 +0000
commit8519c8e0730039e2925ddb7cc8cfa588a1ef9d13 (patch)
tree018507e35db6cfd73f69341c94da93e7de8109c5 /configure
parent3293680dc79c9a4fbbc2bbdd9395a886825a87a2 (diff)
parent28b90d9c19d368645f475e36297ca21c53c38799 (diff)
Merge remote-tracking branch 'remotes/amit-migration/tags/migration-for-2.6-6' into staging
migration: * add avx2 instruction optimization, speeds up zero-page checking on compatible architectures and compilers (gcc 4.9+) * add additional postcopy stats to 'info migrate' output # gpg: Signature made Tue 08 Mar 2016 11:29:48 GMT using RSA key ID 854083B6 # gpg: Good signature from "Amit Shah <amit@amitshah.net>" # gpg: aka "Amit Shah <amit@kernel.org>" # gpg: aka "Amit Shah <amitshah@gmx.net>" * remotes/amit-migration/tags/migration-for-2.6-6: cutils: add avx2 instruction optimization configure: detect ifunc and avx2 attribute Postcopy: Fix sync count in info migrate Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure b/configure
index 0c0472a7da..2b3287641a 100755
--- a/configure
+++ b/configure
@@ -280,6 +280,7 @@ libusb=""
usb_redir=""
opengl=""
opengl_dmabuf="no"
+avx2_opt="no"
zlib="yes"
lzo=""
snappy=""
@@ -1773,6 +1774,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
@@ -4790,6 +4806,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"
@@ -5178,6 +5195,10 @@ if test "$opengl" = "yes" ; then
fi
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