From patchwork Fri Feb 15 10:00:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158486 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp513884jaa; Fri, 15 Feb 2019 02:02:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IZYGbs2aPfVBxf3cwDfZ0alAY2NmJL+nPR+PYwNsuzInprCLPTBqEyHsYWtg68UMNcfjSBd X-Received: by 2002:a25:542:: with SMTP id 63mr5725911ybf.27.1550224961773; Fri, 15 Feb 2019 02:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550224961; cv=none; d=google.com; s=arc-20160816; b=q67n3rSkPN4OJai2pwnqZIJC3UtBseQmKSyl2JH52SpRblGbPLK8vQaVm39CO63eTX ddnWpkSx2+oru+Mw+2psGZI7Co63L7hbtJf2VfKKhSZbcKdpp/SZSsPObvg7CM0y7qkB VL9GdLTSyN0NfurBBClMNp23fVB3/gDRdEw8CTWAw4mgkzHZSO6Jav3pDcyBQUlsOe4u xiIJS6qPIU6eMp/trKYsZT2SUA23eeb9royJYaVaRa9FOWOcDYk4ceJCF8tM9TFfdfkW 3wg97/xAyreWBJdZIKCa+Dp3dO0eP1Qh+jdjhJ7gHa0p5hSXQAwCY9qZlX3yfPT93tRB 1BhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=Vxeu1aKyc1elSVFU6DE1QW+ZgMoxKNvRLwqZ0oorDwQ=; b=S0fKsgDb9Li2I6gwZFG9qtXpx34OWXRICOU80nNzWp4BLWupRtIiYUOnLAX+8VS5Jr mKeplljINXyB569jPAWY7w00MI9G0rqaxkOJ6ukQK/sY+k/ICEEJhZXGyHdhL7pUmXfc rFpyl/fbCYi2eEMQ4i4l0c22wV3qgDOgsNtHBQJuadnDMqPXSF8Xpx7XHg6WBhWEXxvA d21+bm+K3DWttc12MXQfXY1RTH7ElfmpBdNhUj3skSlXw7SL/axbKGF3/rbW1nv9X7pi 4OLB789cpEp+Ls3qvSkYDb8v1m0Kriz2q57eUouHWBKWVnqGdWUpDrAkKP5i2RbLnG5h meIw== ARC-Authentication-Results: i=1; mx.google.com; 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 138si275599ywe.381.2019.02.15.02.02.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:02:41 -0800 (PST) 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; 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]:35742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaKP-0006rG-88 for patch@linaro.org; Fri, 15 Feb 2019 05:02:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJs-0006nK-GY for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000P5-Au for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38791 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008Q8-JL; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJX-00027S-Pq; Fri, 15 Feb 2019 10:01:48 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:49 +0000 Message-Id: <20190215100058.20015-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 08/17] target/ppc: convert xxsel to vector operations 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 55 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 28 deletions(-) -- 2.11.0 diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index 0e8cecb00a..e73197e717 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -1321,40 +1321,39 @@ static void glue(gen_, name)(DisasContext * ctx) \ VSX_XXMRG(xxmrghw, 1) VSX_XXMRG(xxmrglw, 0) -static void gen_xxsel(DisasContext * ctx) +static void xxsel_i64(TCGv_i64 t, TCGv_i64 a, TCGv_i64 b, TCGv_i64 c) { - TCGv_i64 a, b, c, tmp; - if (unlikely(!ctx->vsx_enabled)) { - gen_exception(ctx, POWERPC_EXCP_VSXU); - return; - } - a = tcg_temp_new_i64(); - b = tcg_temp_new_i64(); - c = tcg_temp_new_i64(); - tmp = tcg_temp_new_i64(); - - get_cpu_vsrh(a, xA(ctx->opcode)); - get_cpu_vsrh(b, xB(ctx->opcode)); - get_cpu_vsrh(c, xC(ctx->opcode)); - tcg_gen_and_i64(b, b, c); tcg_gen_andc_i64(a, a, c); - tcg_gen_or_i64(tmp, a, b); - set_cpu_vsrh(xT(ctx->opcode), tmp); + tcg_gen_or_i64(t, a, b); +} - get_cpu_vsrl(a, xA(ctx->opcode)); - get_cpu_vsrl(b, xB(ctx->opcode)); - get_cpu_vsrl(c, xC(ctx->opcode)); +static void xxsel_vec(unsigned vece, TCGv_vec t, TCGv_vec a, + TCGv_vec b, TCGv_vec c) +{ + tcg_gen_and_vec(vece, b, b, c); + tcg_gen_andc_vec(vece, a, a, c); + tcg_gen_or_vec(vece, t, a, b); +} - tcg_gen_and_i64(b, b, c); - tcg_gen_andc_i64(a, a, c); - tcg_gen_or_i64(tmp, a, b); - set_cpu_vsrl(xT(ctx->opcode), tmp); +static void gen_xxsel(DisasContext *ctx) +{ + static const GVecGen4 g = { + .fni8 = xxsel_i64, + .fniv = xxsel_vec, + .vece = MO_64, + }; + int rt = xT(ctx->opcode); + int ra = xA(ctx->opcode); + int rb = xB(ctx->opcode); + int rc = xC(ctx->opcode); - tcg_temp_free_i64(a); - tcg_temp_free_i64(b); - tcg_temp_free_i64(c); - tcg_temp_free_i64(tmp); + if (unlikely(!ctx->vsx_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VSXU); + return; + } + tcg_gen_gvec_4(vsr_full_offset(rt), vsr_full_offset(ra), + vsr_full_offset(rb), vsr_full_offset(rc), 16, 16, &g); } static void gen_xxspltw(DisasContext *ctx)