From nobody Thu Nov 6 10:15:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540375103229433.10048259437633; Wed, 24 Oct 2018 02:58:23 -0700 (PDT) Received: from localhost ([::1]:47179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFFvh-00010B-VG for importer@patchew.org; Wed, 24 Oct 2018 05:58:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFFq6-0004qC-6N for qemu-devel@nongnu.org; Wed, 24 Oct 2018 05:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFFq4-0006CW-66 for qemu-devel@nongnu.org; Wed, 24 Oct 2018 05:52:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gFFq2-00068A-7B for qemu-devel@nongnu.org; Wed, 24 Oct 2018 05:52:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 240C0DC8FB; Wed, 24 Oct 2018 09:52:23 +0000 (UTC) Received: from thuth.com (ovpn-117-39.ams2.redhat.com [10.36.117.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id D35275C543; Wed, 24 Oct 2018 09:52:21 +0000 (UTC) From: Thomas Huth To: Peter Maydell Date: Wed, 24 Oct 2018 10:52:08 +0100 Message-Id: <1540374728-27579-7-git-send-email-thuth@redhat.com> In-Reply-To: <1540374728-27579-1-git-send-email-thuth@redhat.com> References: <1540374728-27579-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 24 Oct 2018 09:52:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/6] configure: Provide option to explicitly disable AVX2 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Liam Merwick The configure script detects if the compiler has AVX2 support and automatically sets avx2_opt=3D"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 Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda Signed-off-by: Thomas Huth --- 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=3D"" opengl=3D"" opengl_dmabuf=3D"no" cpuid_h=3D"no" -avx2_opt=3D"no" +avx2_opt=3D"" zlib=3D"yes" capstone=3D"" lzo=3D"" @@ -1329,6 +1329,10 @@ for opt do ;; --disable-glusterfs) glusterfs=3D"no" ;; + --disable-avx2) avx2_opt=3D"no" + ;; + --enable-avx2) avx2_opt=3D"yes" + ;; --enable-glusterfs) glusterfs=3D"yes" ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) @@ -1703,6 +1707,7 @@ disabled with --disable-FEATURE, default is enabled i= f 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. =20 -if test $cpuid_h =3D yes; then +if test "$cpuid_h" =3D "yes" -a "$avx2_opt" !=3D "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=3D"yes" + else + avx2_opt=3D"no" fi fi =20 --=20 1.8.3.1