From patchwork Wed May 22 04:45:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 164768 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp407762ili; Tue, 21 May 2019 21:52:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFWPkl6JfGJ/7sqwUS4Ke0rHFYhvfum9cgIuFvHwd47AJEGEF3bg08Mc0ZKumn+yomRb9p X-Received: by 2002:a17:906:cc92:: with SMTP id oq18mr42504183ejb.230.1558500757138; Tue, 21 May 2019 21:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558500757; cv=none; d=google.com; s=arc-20160816; b=lH7+axFA5OgBGm5rwvnecYI8QJajmHsT4BO1k30SGClgWPQ/RdSeLTdDkq+PQS8m9S AAKdzrt8fVkkPk/Fpv9DKoeMKhvrpx1O386Y8l8xywHSjBpGPkAvYT6x2J5QuoAi4Equ N8RRchxbXaxwhqBc0uTrIbJNewvN29UuRxxu2ahKhXljZ1mfdsLvkoljiagIp86CgegY 0HnH5kg0Hwlka0Z5YGrEz8GfIMygfm60qTEDTMIFDhUWdP4SSqZThxdtBLs1RZyshSSw 9JYylOgdGb6dktr+uyClkYANrxZKv16Un4x757JkKcNjJ+m0uuvZ0PYibYASOps6hqEj Mdiw== 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=9JaW319F3WMFcPzHzwcBZuNyA8WCze8WfJBXJ+/1WcU=; b=M3Wn3FZMwx7Qp5EY2Y3UZ109VbJklNn/NpmeFiOE7RqyhbMGmLOXvVRAK5al7LCAaN auMARmEzXCQItSMeJIauPhmlV0ILhpXo764lFOtBnPZXki7gsuoQUN187j92HHawBd5E A/kQeYh8swnBx7h1/KPIMMfwIMOfVXgyDWGqpowGgHhv4k6YrkfhH4ZSoF+f9e6MRlD2 AwU4H/g8LLvYsTPdAh+2gCO6Fm14qVNQZYEdzXFG/+tNf6y66yDUmrBFxYhuBQflr/zh RFrRAqy2YwDIak7/+I3JJOERBhvqUJGb+LlcDkFOnZfsywdO8NhkDgx/jjRPyxbOhPRW nJkg== 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=R4jEwaLi; 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 o9si193133ejz.286.2019.05.21.21.52.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 May 2019 21:52:37 -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=R4jEwaLi; 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]:35782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTJEy-00008h-3X for patch@linaro.org; Wed, 22 May 2019 00:52:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTJ8q-0003Lw-AA for qemu-devel@nongnu.org; Wed, 22 May 2019 00:46:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTJ8o-0006aZ-Rs for qemu-devel@nongnu.org; Wed, 22 May 2019 00:46:16 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:54331 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTJ8m-0006We-MU; Wed, 22 May 2019 00:46:14 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4580Ss54Wvz9sN6; Wed, 22 May 2019 14:46:05 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1558500365; bh=K39eTPMxj78aP5BGFsBiRFak42glNHpHZQs21KFAfSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R4jEwaLiJF9xpI/1pE8KtHM7R1WtHoUPDo94xVefteZk5pRZ9ixg7dE41ROMncZpE JGZuP6/Ksn5L7YdmBwI6x/Qp4WNRSmi2ffSifcTj33k5x6X/hkyHFwQ5yl95QpL0yQ JnuXCNEqA2oqSkhIcjp2ny12eey9KDbeBt+TNoZ0= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 22 May 2019 14:45:24 +1000 Message-Id: <20190522044600.16534-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190522044600.16534-1-david@gibson.dropbear.id.au> References: <20190522044600.16534-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 02/38] 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 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> Signed-off-by: David Gibson --- configure | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) -- 2.21.0 diff --git a/configure b/configure index d2fc346302..69402f18b8 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" @@ -6164,7 +6175,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 @@ -7349,7 +7360,7 @@ if test "$linux" = "yes" ; then i386|x86_64|x32) linux_arch=x86 ;; - ppc|ppc64) + ppc|ppc64|ppc64le) linux_arch=powerpc ;; s390x) @@ -7510,7 +7521,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 @@ -7518,6 +7530,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 @@ -7533,7 +7546,8 @@ case "$target_name" in TARGET_ABI_DIR=ppc echo "TARGET_ABI32=y" >> $config_target_mak gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" - target_compiler=$cross_cc_ppc64abi32 + target_compiler=$cross_cc_ppc + target_compiler_cflags="$cross_cc_cflags_ppc" ;; riscv32) TARGET_BASE_ARCH=riscv From patchwork Wed May 22 04:45:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 164767 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp405861ili; Tue, 21 May 2019 21:49:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhHk6ePiX06L+ASevan1JnmSqkWEZaMtwfn+SWt2FMNIV5C7KoTEUD1vHShy/n6WGIkEhn X-Received: by 2002:a50:908a:: with SMTP id c10mr86415928eda.226.1558500578726; Tue, 21 May 2019 21:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558500578; cv=none; d=google.com; s=arc-20160816; b=mUB8gypvO2FU/WYrWi4o/8bI6UQx1BUvvRANYHS4zpC7Ymx6gFyo0ubR8X1m1zPKJT gp/3trLMZqzh9aflKXHyP1U2lgiXdxn7x/rP3j2m4WrRZv6yAgv2IqR5fTCQ4x4zQtnx hbTaAk+Z4/ETmRjqVvN9mixRziD58TEuJokXtDQxgTedEKfQZSFjgqKi6llJyf5yRbwx qBh9dEFyYCDmOS2nDh82fZ+7qgwZh+a0ziEde7rMH7BoBzZl0cyVtFDk1AXKFQ4b9dLd L299nWeVYrbwVBDQe3FyGtc3at2y+9aLbclQrQ22zhilN+VWel376Ck/gNgqikuevUUX TG/g== 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=Hc1/nnHIaV70dc9xPhmRYg8g+XIA8n1WZeQvlaCiEB4=; b=MbaKSEGluGKtdCuYDOnQSY/R/QvFCP6T1uozX47r+9lILc1WZeF5j49Q5sNotx23rY zVCDAcTr6tUSDYCZVBuCFqszqlKj9gZMA0teeYwOKcWXPWLtyiGMktdVEIeb3vSREc5K A7BhGs2+oTHnJJwnNRl6xQVLkAoDAvmgy3kzJsqn2KuOg9HbP98/TAguIQUHdZKTVmUJ zwZkW2Z8kOZXhaSHx2qog2MdVfOIu9rK1NCB+qNdESZjdtFzq1YK7kXR6qTYgptTO3wm Qp4lBF7n3tFvSuwrycb9uTEwWRGd0fjY5ovyVGPTIZJ1GYoMRTiVvn115DOs/f9PVjDY 8i8g== 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=lspAQtN+; 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 hk25si9608554ejb.171.2019.05.21.21.49.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 May 2019 21:49:38 -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=lspAQtN+; 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]:35728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTJC5-000638-LE for patch@linaro.org; Wed, 22 May 2019 00:49:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTJ8p-0003Lu-RJ for qemu-devel@nongnu.org; Wed, 22 May 2019 00:46:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTJ8o-0006aF-R1 for qemu-devel@nongnu.org; Wed, 22 May 2019 00:46:15 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:52035) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTJ8m-0006Wp-Mr; Wed, 22 May 2019 00:46:13 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4580Ss6gwhz9sNT; Wed, 22 May 2019 14:46:05 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1558500365; bh=RiYF6y127JDdRmGpDivNEvRY1BoNuZWjbpiaLNBb2Kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lspAQtN+ZT0irN2j+3s4Lm5742RbpBz+rIAIcdv/15GNfgVbbTQwaJXe0v+V7PKgQ 6DUWCZdA7uoi3TfkzNVm6bzXNciwcoI/ZsxietHqQaZISkRxohoPCmUa9dv/JC29LW pX1TcxlMUoxwoXHFTbpn7Mj1CHzPYCzsvVMuzpWs= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 22 May 2019 14:45:25 +1000 Message-Id: <20190522044600.16534-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190522044600.16534-1-david@gibson.dropbear.id.au> References: <20190522044600.16534-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/38] 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 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 69402f18b8..d0050f9afc 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 22 04:45:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 164769 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp426412ili; Tue, 21 May 2019 22:17:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6H/DLu4OVPKC9t2aj4qwqRJJJBmGHfHwz7big+lGlgjqyp8NwvHKBFYgEVtJMGppz7duj X-Received: by 2002:a50:9705:: with SMTP id c5mr88221873edb.258.1558502256548; Tue, 21 May 2019 22:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558502256; cv=none; d=google.com; s=arc-20160816; b=K8g240/KdHy4mRmJRTn7ZTACoMQ5y8PfUyXK3hZdXFz4egJeKJiytmfukT9Vwr5KT1 1nyavwO0isNtMIaKAo3s2f8R5jHqHReQep7bwYfyC81NIE9laKxYfm2nDX7q/mq5w1J3 ta5uyTLin70SSJz9PgANhSw0HOFi0SsHA8EdJb0d0vJ3V4ERHHByKWtvkbVGq9zNDRFl ZVsP60avpPI40fRIDxVy32watdsoFSMA4iNr0cacDYmXsZ+VmKxf8cNnaCy2nT8IUjOk vhN0Gtz1qzEmxh8fQ/hHGgFAICCrLbeCkCmegB8CLia1fe6OJpBGkS+xoSk/iIex6/Q4 vPfQ== 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=Q4vQpRCrULRKjtDudnOslqA204HDOwhHqNHhJKFh4UE=; b=q3w9SwLy7rn5sabTF7MNyROEbmpJXjnZaKvN846uONcnxJ6OYE6v6D8bT36H/EZKNB IPbbCMb0YwpeS2ETO6sSRQ1OLB3oo9krY/YkOm3E+HQq45OOaL+8Fy6jIq9a31k7WpUW 8HjuDSYY1dbAe558+JoJHvPfLW90wzOMrhcIlq76XKLeZLl56gB1cV3beg1v/aNE6clQ lkNWLibqmz/8kEiEEHC8urCOMD0NBwD3jsg362tDUuEuZ/FxKcOaULoBaxn9YckVPjYF fbFQ1Y+8bD/LE2FJDbkt7XZLsEKXrD7D5KJO2sOKlN/KY/r41sMBhecFDOQiHCvfXEdV sRug== 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=UEqNJoUS; 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 b51si2660024edc.153.2019.05.21.22.17.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 May 2019 22:17:36 -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=UEqNJoUS; 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]:36220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTJd9-0005Rb-9c for patch@linaro.org; Wed, 22 May 2019 01:17:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTJ9H-0003hr-Mx for qemu-devel@nongnu.org; Wed, 22 May 2019 00:46:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTJ9G-0006uW-Ci for qemu-devel@nongnu.org; Wed, 22 May 2019 00:46:43 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:53265 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTJ9F-0006fY-MM; Wed, 22 May 2019 00:46:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4580Sx5nN6z9sPJ; Wed, 22 May 2019 14:46:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1558500369; bh=JovPQt+w+OsaE4OA9JcscahCs/Ep/b23xTHJ4b5HExg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UEqNJoUSrLObRKvdfa8v+dP9LYeHJd9zkmItcnJn9RYbb/nrvqLn1s1gAnHQDrOtQ MxaHHXvGbR4JYUPKur6WB5EY3sOJW10pkp8kRDZ/e3EbVXeD2LkUHe25p0fgA9/8V9 UAnrOs+7PKNJNAtpOsLk97qldHANsPe831GREqFU= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 22 May 2019 14:45:44 +1000 Message-Id: <20190522044600.16534-23-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190522044600.16534-1-david@gibson.dropbear.id.au> References: <20190522044600.16534-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 22/38] 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 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 f5c81acd53..0b22774a9d 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1776,23 +1776,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; @@ -1965,26 +1948,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);