From patchwork Wed Jan 20 09:05:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Liang Z" X-Patchwork-Id: 570590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D1DDC1400CB for ; Wed, 20 Jan 2016 20:10:23 +1100 (AEDT) Received: from localhost ([::1]:41006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLomT-0004M9-Gh for incoming@patchwork.ozlabs.org; Wed, 20 Jan 2016 04:10:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLom2-0003ZS-Ue for qemu-devel@nongnu.org; Wed, 20 Jan 2016 04:09:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLolx-0000yc-W3 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 04:09:54 -0500 Received: from mga01.intel.com ([192.55.52.88]:33449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLolx-0000yW-Pz for qemu-devel@nongnu.org; Wed, 20 Jan 2016 04:09:49 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 20 Jan 2016 01:09:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,320,1449561600"; d="scan'208";a="864528135" Received: from ll.sh.intel.com (HELO localhost) ([10.239.13.27]) by orsmga001.jf.intel.com with ESMTP; 20 Jan 2016 01:09:46 -0800 From: Liang Li To: qemu-devel@nongnu.org Date: Wed, 20 Jan 2016 17:05:41 +0800 Message-Id: <1453280742-20718-2-git-send-email-liang.z.li@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453280742-20718-1-git-send-email-liang.z.li@intel.com> References: <1453280742-20718-1-git-send-email-liang.z.li@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.88 Cc: peter.maydell@linaro.org, Liang Li , mst@redhat.com, rth7680@gmail.com, dgilbert@redhat.com, quintela@redhat.com, stefanha@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, rth@twiddle.net Subject: [Qemu-devel] [PATCH v4 1/2] configure: detect ifunc and avx2 attribute X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. Signed-off-by: Liang Li --- configure | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure b/configure index 44ac9ab..b7f4661 100755 --- a/configure +++ b/configure @@ -310,6 +310,7 @@ smartcard="" libusb="" usb_redir="" opengl="" +avx2_opt="" zlib="yes" lzo="" snappy="" @@ -1827,6 +1828,20 @@ EOF fi ########################################## +# avx2 optimization requirement check + +cat > $TMPC << EOF +static void bar(void) {} +static void foo(void) __attribute__((ifunc("bar"))); +int main(void) { foo(); return 0; } +EOF +if compile_prog "" "-mavx2" ; then + avx2_opt="yes" +else + avx2_opt="no" +fi + +######################################### # zlib check if test "$zlib" != "no" ; then @@ -4855,6 +4870,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" @@ -5236,6 +5252,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