From patchwork Wed May 29 06:49:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 165326 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp9485116ili; Tue, 28 May 2019 23:59:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyttnA0S441Qdtg5Aa0rnT7qb5RrprlEzuRosgUdbMutUeSWfhitDoDy+xdif3l/Ag4UCyc X-Received: by 2002:ac8:2cf4:: with SMTP id 49mr20601699qtx.66.1559113157548; Tue, 28 May 2019 23:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559113157; cv=none; d=google.com; s=arc-20160816; b=xOvVp8srmkjyDWEGcr9SfKWQTwkJntkmPiywRAKZmAUDQjscNQhOI+MvbWupzKJcZ8 JRJr5lu1FuDWYBOkoMNloTxK+SQmDXqR/OQx5GRu2jDClxXh5sPmoyioEcN4mFkfT1Fc 5NCU38RCr52a87sbyVLr/z540dvxOI1r01PjF1j35RlauZBFWzoJDdvTjJuLnoSFrEJk 9X75Jj+STBlYrelceZUGO6L7/A080X039U0S8oUytgIG0/Z1r8uDw5KTSLEvDT/2R7G6 SLTSqo5KawrG6O5uihemtYJPZXwG/x9z0O6fIetNSyct0N3V0QCivPeNYX1B4N6v+txy jsWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=cx+1AFeh8uTnqSbSZkom4OMZjAyNbYNY6Tl3nR1dlJY=; b=1BiNTtZC54AIh2dy+OGcL7Qfk1DLOEZxDk10Km+kfKJiTfgqHRU5RRWU3JwBjDlHjT Iy6isnKfXM2Dod7HjNSPlW1V1JWyJOGsKydNtS3+7MNBBj++wl+lPr4lb4Qa6BF48dK8 pwGf6/EP1haJe8Pm/DSEemZzJhlc6pJJ9KweLLWfzxXA2TOWAwXDZHwD0OPTJ+fwQwde 7HBIXGfcq0or5wPSyhOrgsezBmVgbcRZMZF0IqgRwS8uewVtwEi+OzC5tLzzFtWWlutx PaNUWwI5HcuD/NqE7ZIcP5EJAux7BShhlCgXbnKbAR1y8cV9Cz3xbTT8rfdnXbNfk5Ml dCkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=Vz6F4jI5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 16si3822486qtn.242.2019.05.28.23.59.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 May 2019 23:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=Vz6F4jI5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:48470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsYP-0007iV-4i for patch@linaro.org; Wed, 29 May 2019 02:59:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsPy-0008Cx-Au for qemu-devel@nongnu.org; Wed, 29 May 2019 02:50:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsPw-0002Vp-VY for qemu-devel@nongnu.org; Wed, 29 May 2019 02:50:34 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:60433 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVsPw-0002RC-Dh; Wed, 29 May 2019 02:50:32 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 45DLv202WYz9sBb; Wed, 29 May 2019 16:50:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1559112622; bh=LwgeqNNd+ZrGocsW9YkV/sNtHFn1cTUistNEVdfncKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vz6F4jI5xZxurPa0LSXyqCKCq+Byvqdu66rpJTzdeYb1ah9tQdKxb19jqOa1F9wVq 0F4JWa1mCjIOnAs/id+DqpPo30SbHGzY8s2ANtAAeQ4phm8uGfzZS9Y+4RYoI4Tll9 wfkCet87TzUjshie84+jIFk1VI2WUseKPvN55F8E= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 29 May 2019 16:49:35 +1000 Message-Id: <20190529065017.15149-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190529065017.15149-1-david@gibson.dropbear.id.au> References: <20190529065017.15149-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 02/44] configure: Distinguish ppc64 and ppc64le hosts 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: lvivier@redhat.com, Richard Henderson , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson , rth@twiddle.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We cannot use the ppc64le host compiler to build ppc64(be) guest code. Clean up confusion between cross_cc_powerpc and cross_cc_ppc; make use of the cflags variable as well. Signed-off-by: Richard Henderson Message-Id: <20190501223819.8584-2-richard.henderson@linaro.org> [dwg: Dropped hunk relating to ppc64abi32, it doesn't test properly] Signed-off-by: David Gibson --- configure | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) -- 2.21.0 diff --git a/configure b/configure index 528b9ff705..07eb2b3942 100755 --- a/configure +++ b/configure @@ -198,7 +198,7 @@ supported_kvm_target() { i386:i386 | i386:x86_64 | i386:x32 | \ x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ mips:mips | mipsel:mips | \ - ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | \ + ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | ppc64:ppc64le | \ s390x:s390x) return 0 ;; @@ -502,8 +502,11 @@ cross_cc_arm="arm-linux-gnueabihf-gcc" cross_cc_cflags_armeb="-mbig-endian" cross_cc_i386="i386-pc-linux-gnu-gcc" cross_cc_cflags_i386="" -cross_cc_powerpc="powerpc-linux-gnu-gcc" -cross_cc_powerpc="powerpc-linux-gnu-gcc" +cross_cc_ppc="powerpc-linux-gnu-gcc" +cross_cc_cflags_ppc="-m32" +cross_cc_ppc64="powerpc-linux-gnu-gcc" +cross_cc_cflags_ppc64="-m64" +cross_cc_ppc64le="powerpc64le-linux-gnu-gcc" enabled_cross_compilers="" @@ -700,7 +703,11 @@ elif check_define __sparc__ ; then fi elif check_define _ARCH_PPC ; then if check_define _ARCH_PPC64 ; then - cpu="ppc64" + if check_define _LITTLE_ENDIAN ; then + cpu="ppc64le" + else + cpu="ppc64" + fi else cpu="ppc" fi @@ -731,10 +738,14 @@ ARCH= # Note that this case should only have supported host CPUs, not guests. case "$cpu" in ppc|ppc64|s390|s390x|sparc64|x32|riscv32|riscv64) - cpu="$cpu" supported_cpu="yes" eval "cross_cc_${cpu}=\$host_cc" ;; + ppc64le) + ARCH="ppc64" + supported_cpu="yes" + cross_cc_ppc64le=$host_cc + ;; i386|i486|i586|i686|i86pc|BePC) cpu="i386" supported_cpu="yes" @@ -1538,8 +1549,8 @@ case "$cpu" in ppc) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" - cross_cc_powerpc=$cc - cross_cc_cflags_powerpc=$CPU_CFLAGS + cross_cc_ppc=$cc + cross_cc_cflags_ppc="$CPU_CFLAGS" ;; ppc64) CPU_CFLAGS="-m64" @@ -6191,7 +6202,7 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ fi done fi -if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" ; then +if test "$ARCH" = "ppc64" && test "$targetos" != "Darwin" ; then roms="$roms spapr-rtas" fi @@ -7378,7 +7389,7 @@ if test "$linux" = "yes" ; then i386|x86_64|x32) linux_arch=x86 ;; - ppc|ppc64) + ppc|ppc64|ppc64le) linux_arch=powerpc ;; s390x) @@ -7539,7 +7550,8 @@ case "$target_name" in ;; ppc) gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" - target_compiler=$cross_cc_powerpc + target_compiler=$cross_cc_ppc + target_compiler_cflags="$cross_cc_cflags_ppc" ;; ppc64) TARGET_BASE_ARCH=ppc @@ -7547,6 +7559,7 @@ case "$target_name" in mttcg=yes gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" target_compiler=$cross_cc_ppc64 + target_compiler_cflags="$cross_cc_cflags_ppc64" ;; ppc64le) TARGET_ARCH=ppc64 From patchwork Wed May 29 06:49:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 165327 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp9488405ili; Wed, 29 May 2019 00:02:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaqtWaqCplB7T/rwCYRoQHEGDEB58EmomvrV3zhhcGCQOIDSkSdXeXqHzkgytgvcurgHRv X-Received: by 2002:ae9:f20c:: with SMTP id m12mr14310889qkg.58.1559113343771; Wed, 29 May 2019 00:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559113343; cv=none; d=google.com; s=arc-20160816; b=Rky5nqZP7ACAZUw2LdGdZbVBspgLhwMm6BNRmapdlUNIHvxvHbfVb347TtL/CFCDuc 6bwwq8KPStkZU1QbQRHrEp9dmNl3duZm+z7JBEwJ2zYUWMQkZmLuXHnvXCXQDczLLH49 rKs5RwTq65fY/Y2Bi2z79OZxutiY12jSmxMaTnTu/k3c+KzJD1T5lUfh0LAyj7TBRsll Tce9yHeLn5/POU8MP7pH2mfxm7cIjgIMJqnOCU2Wn53yXyF4u/0Q/XLpLRi5Zj1cWA36 w2FnKNqtqqgevV6tASdtpWOLxoIrJOL7NrMNm27VrXHfUUixE7J/4guGUSnQnq+nLDaS WaKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Ib6eBsaAG0DWjx7CK/1LXGxc+lVTp1TGMJAVpYjChYw=; b=PZQISJVEE9bnSID00dogBGff4ZbjXQfPqtsVZJ2zDnWQUc3hKX9GV6f2RGxmsiPq8U 9zfw2OhQHmDsrYFsu8zvd8t/rTmV7qduuMkiejvuPQdLxV6g88u/FDSOtNR7kVdrXOtg E7+Vo+sFW7jjOn1gyXOCAqdC/Weng07k1c7nmH3e5NH5dBgwV8TDvfvg17UpxR+tbdMJ NpYWUviK4H68Z1KKf/ZfoSGk2OxER5up0Dh95fAu8rIIMHm9HODhC//lw3Y2xixfKQWu 8ilKe6ToQKks+ZkitF0IoWlBBHORgiGhtST1jleFfVm1+rav+rChk8MKwSNzbRC8acvi eOcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=CrO3yCLt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d53si1771785qvh.213.2019.05.29.00.02.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 29 May 2019 00:02:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=CrO3yCLt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:48535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsbP-0001xi-9f for patch@linaro.org; Wed, 29 May 2019 03:02:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsPy-0008Cy-DA for qemu-devel@nongnu.org; Wed, 29 May 2019 02:50:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsPx-0002WF-Am for qemu-devel@nongnu.org; Wed, 29 May 2019 02:50:34 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:42957 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVsPw-0002R5-Ur; Wed, 29 May 2019 02:50:33 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 45DLv14QZPz9s7h; Wed, 29 May 2019 16:50:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1559112621; bh=YaSN+iFW1Gh8YK/6ehrDfQFBGV1I3FwqdyUiVRfonrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CrO3yCLt2PIl3kHY3adWzIAvsZ1/KaJE5ts5+BLOYRCehJTSrWJdo9yxmcoL68Jvm HQrfCGSe3DaUI1MDyn32LwAPQb91W0SRwMdUc+c3pq2QZNlFcl0xzp3DhkI5WmRYe8 ME5RIrbowbqgjSN4jF+V+8rJtJvy7FHQYkXFYfno= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 29 May 2019 16:49:36 +1000 Message-Id: <20190529065017.15149-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190529065017.15149-1-david@gibson.dropbear.id.au> References: <20190529065017.15149-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 03/44] configure: Use quotes around uses of $CPU_CFLAGS 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: lvivier@redhat.com, Richard Henderson , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson , rth@twiddle.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson About half of the values to which CPU_CFLAGS is set have multiple space separated arguments. Signed-off-by: Richard Henderson Message-Id: <20190501223819.8584-3-richard.henderson@linaro.org> Signed-off-by: David Gibson --- configure | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.21.0 diff --git a/configure b/configure index 07eb2b3942..991fef51ee 100755 --- a/configure +++ b/configure @@ -1556,37 +1556,37 @@ case "$cpu" in CPU_CFLAGS="-m64" LDFLAGS="-m64 $LDFLAGS" cross_cc_ppc64=$cc - cross_cc_cflags_ppc64=$CPU_CFLAGS + cross_cc_cflags_ppc64="$CPU_CFLAGS" ;; sparc) CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" LDFLAGS="-m32 -mv8plus $LDFLAGS" cross_cc_sparc=$cc - cross_cc_cflags_sparc=$CPU_CFLAGS + cross_cc_cflags_sparc="$CPU_CFLAGS" ;; sparc64) CPU_CFLAGS="-m64 -mcpu=ultrasparc" LDFLAGS="-m64 $LDFLAGS" cross_cc_sparc64=$cc - cross_cc_cflags_sparc64=$CPU_CFLAGS + cross_cc_cflags_sparc64="$CPU_CFLAGS" ;; s390) CPU_CFLAGS="-m31" LDFLAGS="-m31 $LDFLAGS" cross_cc_s390=$cc - cross_cc_cflags_s390=$CPU_CFLAGS + cross_cc_cflags_s390="$CPU_CFLAGS" ;; s390x) CPU_CFLAGS="-m64" LDFLAGS="-m64 $LDFLAGS" cross_cc_s390x=$cc - cross_cc_cflags_s390x=$CPU_CFLAGS + cross_cc_cflags_s390x="$CPU_CFLAGS" ;; i386) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" cross_cc_i386=$cc - cross_cc_cflags_i386=$CPU_CFLAGS + cross_cc_cflags_i386="$CPU_CFLAGS" ;; x86_64) # ??? Only extremely old AMD cpus do not have cmpxchg16b. @@ -1595,13 +1595,13 @@ case "$cpu" in CPU_CFLAGS="-m64 -mcx16" LDFLAGS="-m64 $LDFLAGS" cross_cc_x86_64=$cc - cross_cc_cflags_x86_64=$CPU_CFLAGS + cross_cc_cflags_x86_64="$CPU_CFLAGS" ;; x32) CPU_CFLAGS="-mx32" LDFLAGS="-mx32 $LDFLAGS" cross_cc_i386=$cc - cross_cc_cflags_i386=$CPU_CFLAGS + cross_cc_cflags_i386="$CPU_CFLAGS" ;; # No special flags required for other host CPUs esac From patchwork Wed May 29 06:49:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 165328 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp9500932ili; Wed, 29 May 2019 00:16:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqysugfqxsA7L5mZY8GADtUv0sJRTa+PoLMSYSIlXQyFLsgvLFDwJC756m9d82CiDSCayta1 X-Received: by 2002:ac8:3918:: with SMTP id s24mr6278726qtb.226.1559114182956; Wed, 29 May 2019 00:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559114182; cv=none; d=google.com; s=arc-20160816; b=EzdwWxvvXXLnipL/J5TF/dPgXzCvI68C/MneCKvcGXqKPYPZ3Zmp/NLYiGNnHtW1pN NReyWcMuyxxyQgHL9w04btzG7fTaDaSMTrKxP5x9t9V7TZn/NvC3c81KvNbvWfrZJML5 zdvQBrWlMZvrdoSknjhL2cf9m5INxDgYZIA97X4PWQ+OR7HV/XuW8aXTudyijopORBi3 HQ7z9buQvUoTjIQiGaZ2cU3cN4k4rwrzdFE6zkxfPddpTlLnvyTag/4NUo8NMxlnjmvW ryeQzDsF70Adh5XdeqRW97hoI47Z7mlRpUiTx6PXkvlBXbRkFFp4pXEjsrYcXaa3Nkkr Pw7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=cGTsSedi6NTN4AtiAmmwbsGaLUlPF6HtVyOR3SGnuPA=; b=IFzVOrApTYrdX8VsUJfTwblLqcEcWlDazp8RlYHBQn2+ojBGYQAkmUNqYdEFqQ4AGq Ak3uugpP9pqbE6nJ9GSBmwLPqfczO9YTXULl4CCVq7CsuHkFbGsThYBknumIy7yuK36L A0kl755Ng9olxbdc5ezotCHL67Dvf0IpjMqreSN74dv0pAGlTdkRYScn93g4BvV010gH jt82sPYvHuKhQm7+/iNpZSBmIpWcgbv1wIYxzMRwtZGKi1KOuGRAvovJGFKFFy1HuwoF VRCE0IcO+QOyo4pzoPquaCYc8i2D5s76x3aaSvt/bHdQwibychxWsYK7gESSFfuEnpyN btJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=Jgas2urf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o185si3750658qkd.256.2019.05.29.00.16.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 29 May 2019 00:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=Jgas2urf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:48765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsow-0004of-Dr for patch@linaro.org; Wed, 29 May 2019 03:16:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsQR-0000Ld-FX for qemu-devel@nongnu.org; Wed, 29 May 2019 02:51:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsQQ-0002qo-9z for qemu-devel@nongnu.org; Wed, 29 May 2019 02:51:03 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:60617 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVsQP-0002cV-Lq; Wed, 29 May 2019 02:51:02 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 45DLv55CHMz9sPG; Wed, 29 May 2019 16:50:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1559112625; bh=uN6drKYKwxES9bskyqe9lxIMQqaWXGheRiRszvbh5qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jgas2urfJuwkjhYdBPVxJtm+upb7wfvE42t+BJyOqmdFTLxBDkYI/dwuMoYuSYnFP ZXQ+XCWXZqwtjIlyRJpAPa+EDV92DtyTK8w/G6tKQym09jAhfWhc5RuvzWZ6uXNKzA KnjVFXBW1YKeq33FdZIcwkKHRGeEEJ1sSQ4w/Xkg= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 29 May 2019 16:49:56 +1000 Message-Id: <20190529065017.15149-24-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190529065017.15149-1-david@gibson.dropbear.id.au> References: <20190529065017.15149-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 23/44] target/ppc: Use vector variable shifts for VSL, VSR, VSRA 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: lvivier@redhat.com, Richard Henderson , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson , rth@twiddle.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The gvec expanders take care of masking the shift amount against the element width. Signed-off-by: Richard Henderson Message-Id: <20190518191430.21686-2-richard.henderson@linaro.org> Signed-off-by: David Gibson --- target/ppc/helper.h | 12 ---------- target/ppc/int_helper.c | 37 ----------------------------- target/ppc/translate/vmx-impl.inc.c | 24 +++++++++---------- 3 files changed, 12 insertions(+), 61 deletions(-) -- 2.21.0 diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 638a6e99c4..02b67a333e 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -180,18 +180,6 @@ DEF_HELPER_3(vmuloub, void, avr, avr, avr) DEF_HELPER_3(vmulouh, void, avr, avr, avr) DEF_HELPER_3(vmulouw, void, avr, avr, avr) DEF_HELPER_3(vmuluwm, void, avr, avr, avr) -DEF_HELPER_3(vsrab, void, avr, avr, avr) -DEF_HELPER_3(vsrah, void, avr, avr, avr) -DEF_HELPER_3(vsraw, void, avr, avr, avr) -DEF_HELPER_3(vsrad, void, avr, avr, avr) -DEF_HELPER_3(vsrb, void, avr, avr, avr) -DEF_HELPER_3(vsrh, void, avr, avr, avr) -DEF_HELPER_3(vsrw, void, avr, avr, avr) -DEF_HELPER_3(vsrd, void, avr, avr, avr) -DEF_HELPER_3(vslb, void, avr, avr, avr) -DEF_HELPER_3(vslh, void, avr, avr, avr) -DEF_HELPER_3(vslw, void, avr, avr, avr) -DEF_HELPER_3(vsld, void, avr, avr, avr) DEF_HELPER_3(vslo, void, avr, avr, avr) DEF_HELPER_3(vsro, void, avr, avr, avr) DEF_HELPER_3(vsrv, void, avr, avr, avr) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 093ef74b59..8ce89f2ad9 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1791,23 +1791,6 @@ VSHIFT(l, 1) VSHIFT(r, 0) #undef VSHIFT -#define VSL(suffix, element, mask) \ - void helper_vsl##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ - { \ - int i; \ - \ - for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ - unsigned int shift = b->element[i] & mask; \ - \ - r->element[i] = a->element[i] << shift; \ - } \ - } -VSL(b, u8, 0x7) -VSL(h, u16, 0x0F) -VSL(w, u32, 0x1F) -VSL(d, u64, 0x3F) -#undef VSL - void helper_vslv(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i; @@ -1980,26 +1963,6 @@ VNEG(vnegw, s32) VNEG(vnegd, s64) #undef VNEG -#define VSR(suffix, element, mask) \ - void helper_vsr##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ - { \ - int i; \ - \ - for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ - unsigned int shift = b->element[i] & mask; \ - r->element[i] = a->element[i] >> shift; \ - } \ - } -VSR(ab, s8, 0x7) -VSR(ah, s16, 0xF) -VSR(aw, s32, 0x1F) -VSR(ad, s64, 0x3F) -VSR(b, u8, 0x7) -VSR(h, u16, 0xF) -VSR(w, u32, 0x1F) -VSR(d, u64, 0x3F) -#undef VSR - void helper_vsro(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int sh = (b->VsrB(0xf) >> 3) & 0xf; diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 6861f4c5b9..663275b729 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -530,21 +530,21 @@ GEN_VXFORM(vmuleuw, 4, 10); GEN_VXFORM(vmulesb, 4, 12); GEN_VXFORM(vmulesh, 4, 13); GEN_VXFORM(vmulesw, 4, 14); -GEN_VXFORM(vslb, 2, 4); -GEN_VXFORM(vslh, 2, 5); -GEN_VXFORM(vslw, 2, 6); +GEN_VXFORM_V(vslb, MO_8, tcg_gen_gvec_shlv, 2, 4); +GEN_VXFORM_V(vslh, MO_16, tcg_gen_gvec_shlv, 2, 5); +GEN_VXFORM_V(vslw, MO_32, tcg_gen_gvec_shlv, 2, 6); GEN_VXFORM(vrlwnm, 2, 6); GEN_VXFORM_DUAL(vslw, PPC_ALTIVEC, PPC_NONE, \ vrlwnm, PPC_NONE, PPC2_ISA300) -GEN_VXFORM(vsld, 2, 23); -GEN_VXFORM(vsrb, 2, 8); -GEN_VXFORM(vsrh, 2, 9); -GEN_VXFORM(vsrw, 2, 10); -GEN_VXFORM(vsrd, 2, 27); -GEN_VXFORM(vsrab, 2, 12); -GEN_VXFORM(vsrah, 2, 13); -GEN_VXFORM(vsraw, 2, 14); -GEN_VXFORM(vsrad, 2, 15); +GEN_VXFORM_V(vsld, MO_64, tcg_gen_gvec_shlv, 2, 23); +GEN_VXFORM_V(vsrb, MO_8, tcg_gen_gvec_shrv, 2, 8); +GEN_VXFORM_V(vsrh, MO_16, tcg_gen_gvec_shrv, 2, 9); +GEN_VXFORM_V(vsrw, MO_32, tcg_gen_gvec_shrv, 2, 10); +GEN_VXFORM_V(vsrd, MO_64, tcg_gen_gvec_shrv, 2, 27); +GEN_VXFORM_V(vsrab, MO_8, tcg_gen_gvec_sarv, 2, 12); +GEN_VXFORM_V(vsrah, MO_16, tcg_gen_gvec_sarv, 2, 13); +GEN_VXFORM_V(vsraw, MO_32, tcg_gen_gvec_sarv, 2, 14); +GEN_VXFORM_V(vsrad, MO_64, tcg_gen_gvec_sarv, 2, 15); GEN_VXFORM(vsrv, 2, 28); GEN_VXFORM(vslv, 2, 29); GEN_VXFORM(vslo, 6, 16);