From nobody Thu Nov 13 22:09:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1582688265; cv=none; d=zohomail.com; s=zohoarc; b=UQxlRUKHhf1gvy//giLry7dhypIqGspS5EyZLEIW8IEy2+61Oaa5uxM7ldj8p1MsO8Kgal5P06sWa7l7iCTHszWYXZfRntFoAPTX8XPI7T7Clltg838xc5H6UosWDHfTK8wLgkGx8Rnx/KvMiCbbCN4c009g0gh0uW+oYXGk8rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582688265; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=YsxVSw6EQ427vNgYlsMHMuVV4ic04CRZKC6FHMO9LBE=; b=NpPMoibkWwbASJyOYyv4c0pOyWNyctI5Ba9AW58pbBKCB8k/ttFop25G74koH03T1cGvSNi15cxyGpX8LNoUvpE91Ztj1/v++ODgattent+e5OQv56m4EobDa4AKJie5q/tuQkNwhxW/pm9YtNvnoVhQnFUNqR9tpxEUVnZDU4A= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582688265679454.4421358571484; Tue, 25 Feb 2020 19:37:45 -0800 (PST) Received: from localhost ([::1]:37606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6nW4-0005Fl-DP for importer@patchew.org; Tue, 25 Feb 2020 22:37:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49101) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6nVJ-0004M1-Sc for qemu-devel@nongnu.org; Tue, 25 Feb 2020 22:36:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6nVI-0001RJ-CO for qemu-devel@nongnu.org; Tue, 25 Feb 2020 22:36:57 -0500 Received: from mga02.intel.com ([134.134.136.20]:46405) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6nVI-0001K4-2P for qemu-devel@nongnu.org; Tue, 25 Feb 2020 22:36:56 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2020 19:36:54 -0800 Received: from sqa-gate.sh.intel.com (HELO robert-ivt.tsp.org) ([10.239.48.212]) by orsmga008.jf.intel.com with ESMTP; 25 Feb 2020 19:36:52 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,486,1574150400"; d="scan'208";a="231256487" From: Robert Hoo To: qemu-devel@nongnu.org, pbonzini@redhat.com, richard.henderson@linaro.org, laurent@vivier.eu, philmd@redhat.com, berrange@redhat.com Subject: [PATCH v2 1/2] configure: introduce configure option avx512f Date: Wed, 26 Feb 2020 11:35:41 +0800 Message-Id: <1582688142-113997-2-git-send-email-robert.hu@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582688142-113997-1-git-send-email-robert.hu@linux.intel.com> References: <1582688142-113997-1-git-send-email-robert.hu@linux.intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.20 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.hu@intel.com, chao.p.peng@intel.com, Robert Hoo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Introduce {enable,disable}-avx512f configure option. It is by default disab= led. Only when user explicitly enable-avx512f and compiling environment supports AVX512F, CONFIG_AVX512F_OPT will be defined. AVX512F instruction set is available since Intel Skylake. More info: https://software.intel.com/sites/default/files/managed/c5/15/architecture-i= nstruction-set-extensions-programming-reference.pdf Signed-off-by: Robert Hoo --- configure | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/configure b/configure index d57261e..a0b41ce 100755 --- a/configure +++ b/configure @@ -1395,6 +1395,11 @@ for opt do ;; --enable-avx2) avx2_opt=3D"yes" ;; + --disable-avx512f) avx512f_opt=3D"no" + ;; + --enable-avx512f) avx512f_opt=3D"yes" + ;; + --enable-glusterfs) glusterfs=3D"yes" ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) @@ -1825,6 +1830,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: tcmalloc tcmalloc support jemalloc jemalloc support avx2 AVX2 optimization support + avx512f AVX512F optimization support replication replication support opengl opengl support virglrenderer virgl rendering support @@ -5518,6 +5524,36 @@ EOF fi fi =20 +########################################## +# 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" =3D "yes" && test "$avx512f_opt" =3D "yes"; then + cat > $TMPC << EOF +#pragma GCC push_options +#pragma GCC target("avx512f") +#include +#include +static int bar(void *a) { + __m512i x =3D *(__m512i *)a; + return _mm512_test_epi64_mask(x, x); +} +int main(int argc, char *argv[]) +{ + return bar(argv[0]); +} +EOF + if ! compile_object "" ; then + avx512f_opt=3D"no" + fi +else + avx512f_opt=3D"no" +fi + ######################################## # check if __[u]int128_t is usable. =20 @@ -6650,6 +6686,7 @@ echo "libxml2 $libxml2" echo "tcmalloc support $tcmalloc" echo "jemalloc support $jemalloc" echo "avx2 optimization $avx2_opt" +echo "avx512f optimization $avx512f_opt" echo "replication support $replication" echo "VxHS block device $vxhs" echo "bochs support $bochs" @@ -7200,6 +7237,10 @@ if test "$avx2_opt" =3D "yes" ; then echo "CONFIG_AVX2_OPT=3Dy" >> $config_host_mak fi =20 +if test "$avx512f_opt" =3D "yes" ; then + echo "CONFIG_AVX512F_OPT=3Dy" >> $config_host_mak +fi + if test "$lzo" =3D "yes" ; then echo "CONFIG_LZO=3Dy" >> $config_host_mak fi --=20 1.8.3.1