From patchwork Mon Feb 18 14:30:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158632 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2616860jaa; Mon, 18 Feb 2019 07:24:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IbeJs7EJOYkHFp2IZyNKzceG3JDpExBxtLzKpRk9g+Eea/5ICyHNIwHbJxF0ekibcC9qsIh X-Received: by 2002:a25:9c42:: with SMTP id x2mr18756252ybo.199.1550503481816; Mon, 18 Feb 2019 07:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503481; cv=none; d=google.com; s=arc-20160816; b=Y2n/wHBR54L3f2ecJcHsjnjPnDu5PiLytUyo6Qn204WCn6Ed49jMP4UIc4ya1l1Niz zB5p5wbx444KXA54SD+pdTVGpdwOzE5UYs9b7BGXGLz6uf8vSx/e1zeCoWHVGMM8QQ09 FhxSC8S6GbSyRSAbGFYklnplfjFcccpnndrQT+8CIVb6CcIcojiIFzxbdIX9tVyj1GKV 8CY6eLO32m84LNQlxuOyQ+etJMfqtzDnsGYWj4kd0nVnFX6JxKjwT1z/R0zIcmMmruPD ARbzlyUIh35suUQCf+ag5l9DQfBfsSC3zb8eig3wbkWlpTgSzTEQWifWugre7yXluPKJ FV2Q== 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=hw4LjAaa3jVptJqmQVmPsbUlAFwTG3iPpyWz+lp7jL0=; b=OjTkz5a72QWkp88lcfVWaHZcck6SaShD3JrkCW+lq7gjzNpGqO9D0Y9jD4YKzjJGDK qU/C9GAkkDUZ3xymUF1GRzRBx2FxnoxtIEwPNODXYjR692FPwNs+JOlX9Hu8pQIrYfNp krDY0a5KcWbu0YYiiJ0FbxJNCOPQLYqw9qt7+9112j2HTZJVeWVlGN10EoQQLx9Pz6Eg Kn4/SHQ5kSoyBicLi02TxX7xVRY83bqJ6MAogxo2e6snwAaFoWTOHCmi4EGHPq6QE5cF wtMkSbwq6crExeEjDdPoCWIdsWjJujoR95Oi+KzDZpw1EojzufEpd1pvScDZEBNxQCTn f9ag== 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=nbxduOEK; 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 w205si8019430ybw.161.2019.02.18.07.24.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:24: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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=nbxduOEK; 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]:60441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkme-00077X-VE for patch@linaro.org; Mon, 18 Feb 2019 10:24:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjxw-0006ch-Hk for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjxt-0003Bg-Gu for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:16 -0500 Received: from ozlabs.org ([203.11.71.1]:35709) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjxs-00038z-8g; Mon, 18 Feb 2019 09:32:13 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s05q6Xz9sRQ; Tue, 19 Feb 2019 01:31:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500276; bh=IpQLKVTonX96XBiQgzaJBL6YAZ1p1M2fpTVxrTKQlUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbxduOEKTjFzwytgxC3JkaeID+NSE+BXgmiKeaVNlnPJrZwwSZa6vUvKNP9tCaz1B 21b57ej1BX+WR6txs3BNKL9m6yuYn/evrgsIeERfiJZq9ORIls0W+bdT4fM282U2aF x1ZbPkNWLgIHuVimy66OgcAfY9fIEe4cJqb/g9sQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:37 +1100 Message-Id: <20190218143049.17142-32-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-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 31/43] target/ppc: convert VSX logical operations 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.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 Signed-off-by: Richard Henderson Acked-by: David Gibson Message-Id: <20190215100058.20015-6-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 43 ++++++++++++----------------- 1 file changed, 17 insertions(+), 26 deletions(-) -- 2.20.1 diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index ed4fdceacf..2576d81ac5 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -10,6 +10,11 @@ static inline void set_vsr(int n, TCGv_i64 src) tcg_gen_st_i64(src, cpu_env, offsetof(CPUPPCState, vsr[n].u64[1])); } +static inline int vsr_full_offset(int n) +{ + return offsetof(CPUPPCState, vsr[n].u64[0]); +} + static inline void get_cpu_vsrh(TCGv_i64 dst, int n) { if (n < 32) { @@ -1255,40 +1260,26 @@ static void gen_xxbrw(DisasContext *ctx) tcg_temp_free_i64(xbl); } -#define VSX_LOGICAL(name, tcg_op) \ +#define VSX_LOGICAL(name, vece, tcg_op) \ static void glue(gen_, name)(DisasContext * ctx) \ { \ - TCGv_i64 t0; \ - TCGv_i64 t1; \ - TCGv_i64 t2; \ if (unlikely(!ctx->vsx_enabled)) { \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - t0 = tcg_temp_new_i64(); \ - t1 = tcg_temp_new_i64(); \ - t2 = tcg_temp_new_i64(); \ - get_cpu_vsrh(t0, xA(ctx->opcode)); \ - get_cpu_vsrh(t1, xB(ctx->opcode)); \ - tcg_op(t2, t0, t1); \ - set_cpu_vsrh(xT(ctx->opcode), t2); \ - get_cpu_vsrl(t0, xA(ctx->opcode)); \ - get_cpu_vsrl(t1, xB(ctx->opcode)); \ - tcg_op(t2, t0, t1); \ - set_cpu_vsrl(xT(ctx->opcode), t2); \ - tcg_temp_free_i64(t0); \ - tcg_temp_free_i64(t1); \ - tcg_temp_free_i64(t2); \ + tcg_op(vece, vsr_full_offset(xT(ctx->opcode)), \ + vsr_full_offset(xA(ctx->opcode)), \ + vsr_full_offset(xB(ctx->opcode)), 16, 16); \ } -VSX_LOGICAL(xxland, tcg_gen_and_i64) -VSX_LOGICAL(xxlandc, tcg_gen_andc_i64) -VSX_LOGICAL(xxlor, tcg_gen_or_i64) -VSX_LOGICAL(xxlxor, tcg_gen_xor_i64) -VSX_LOGICAL(xxlnor, tcg_gen_nor_i64) -VSX_LOGICAL(xxleqv, tcg_gen_eqv_i64) -VSX_LOGICAL(xxlnand, tcg_gen_nand_i64) -VSX_LOGICAL(xxlorc, tcg_gen_orc_i64) +VSX_LOGICAL(xxland, MO_64, tcg_gen_gvec_and) +VSX_LOGICAL(xxlandc, MO_64, tcg_gen_gvec_andc) +VSX_LOGICAL(xxlor, MO_64, tcg_gen_gvec_or) +VSX_LOGICAL(xxlxor, MO_64, tcg_gen_gvec_xor) +VSX_LOGICAL(xxlnor, MO_64, tcg_gen_gvec_nor) +VSX_LOGICAL(xxleqv, MO_64, tcg_gen_gvec_eqv) +VSX_LOGICAL(xxlnand, MO_64, tcg_gen_gvec_nand) +VSX_LOGICAL(xxlorc, MO_64, tcg_gen_gvec_orc) #define VSX_XXMRG(name, high) \ static void glue(gen_, name)(DisasContext * ctx) \