From patchwork Tue Dec 18 06:38:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154100 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3356509ljp; Mon, 17 Dec 2018 22:57:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xuukukn5QsgjKoNyYyICKry/m12gSCY4MeCiBB7l8BpS0gQ6MHL3Y46NhzVNCyRGeRrHVc X-Received: by 2002:a37:4e58:: with SMTP id c85mr15312626qkb.27.1545116239987; Mon, 17 Dec 2018 22:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545116239; cv=none; d=google.com; s=arc-20160816; b=AixPA5gmFtcY473DH4gwaLmJIPJkANYF3zwd5Kq6LQzQeGfXR91uRSkuL/aUiDnwzU gfYNi9TR3d7KJ6qlID/DeSghEwhBA23dM3d22Y9aW2ZnfRI+HVP8wb8O2cSrAHigoDRn 6tDNNa86ElZrTdSfQBxQXaifVemEMY6V+4wnrHVmWMsoyhqNMkIS6mhzOCf775TUaDtx XCGRqcMLkQXnYJ98k6YsKRCEX7iBcLDMVyYBjZM6QJH99X9OakJK/khx7jHvJjvMtu4d ouw1zNF+efj4ABfdc6xT+vD09eaQlFNROMApv6DYmqAdKPJ+7kTDcV1xaFTX6BkSZZ7k kD4g== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=/mPaOY+aA1IJmM7Rfj1xBIO/Pp254zxtD1fh9vhH2PQ=; b=hSe7lXyLSRPiJEGL9yZqAd2XxD1qbVNj0e5IPY9/JCfYyISm5CVPyc9FdVyYJNZO27 PQDKlk9knjmxL4bU4b7J3EGxWxn3vQpu0iJG8+5kkzbwI0aG5i9TY+yrYngcKrwwEgyJ C/drDJ4dkklKsmnMZNMCMOna3BSQ+6ejRZVaTJH9CCfwDOzjKE3fpW18mWs2hanB7TpY XgYI+kJoa3Yy+QPr4O8sPKA22RRANGmtEkB7tjpb3iNlRblU1cuguHK6gLM4If5fSehJ gw6qfeHyF4ZS471OHFINm8w5anMcFB8ZNFgBVMWAhu5j5tVBqgLbVslVYConb6pQrDT6 EHvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pv3MZmXU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z2si2162713qvj.66.2018.12.17.22.57.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Dec 2018 22:57:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pv3MZmXU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ9Jf-0007YX-ES for patch@linaro.org; Tue, 18 Dec 2018 01:57:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ92y-0001iH-59 for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ92s-0002tH-G7 for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:40:04 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:34060) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZ92r-0002Ta-Rg for qemu-devel@nongnu.org; Tue, 18 Dec 2018 01:39:58 -0500 Received: by mail-pg1-x52b.google.com with SMTP id j10so6136811pga.1 for ; Mon, 17 Dec 2018 22:39:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/mPaOY+aA1IJmM7Rfj1xBIO/Pp254zxtD1fh9vhH2PQ=; b=Pv3MZmXU+gqUEI5LSc4x45XTYcvhmXnFxL9zVKVUEg1iJsDoO1XMW/nBgqNu+jp0ok pJeHtommkLHL4eOKZ9DmKRUX57D3y1ezBqPUm/ZEuK7H+TjQguWdsUPQDB15jwakG2sC Hlmz/IrSYWKM+DshlMafgvnsoyPrFQFxrWWVc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/mPaOY+aA1IJmM7Rfj1xBIO/Pp254zxtD1fh9vhH2PQ=; b=Bibj5fuKb22nvGK17i1TxE7h3sxrfQ+lrrPueq5ciImt073hRHk5yYhjtIzRC/I6A9 duIDrTCEZRcE1DhaR2YUcT//s6pcsRZs6rwdFlGU9rhtJzo1L6uJ1u0eAEVjQM6+wxDX D15sd5eddTP5tbcxCbcNxQK3FroKf6uCN2AXGhqd4KOS5Hx8mXnlHw+9hHxWSOVXrYpn UNHhbm+si69oevvRqYudIJsCNsIDGQGVKUs92GaRwoOhwxMmeQI10II4r4Sf2ts63FQK bTJwi+1GnRFZaJBTt7erWN4Qvt1InIwMIDtDbBUEV5wk23NlEly/Cso0wyrF2dS30Swr 3CVw== X-Gm-Message-State: AA+aEWZgGMJxvoss8n/qr+91oLHwP/bpB9jVj/glYquKdFlF2upzzi9y 7w1p3NMKnlKudw7L+WjDdFDRtBi0L30= X-Received: by 2002:a65:5a4c:: with SMTP id z12mr14674029pgs.188.1545115183377; Mon, 17 Dec 2018 22:39:43 -0800 (PST) Received: from cloudburst.twiddle.net (97-126-115-157.tukw.qwest.net. [97.126.115.157]) by smtp.gmail.com with ESMTPSA id c7sm27072509pfh.18.2018.12.17.22.39.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 22:39:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 22:38:59 -0800 Message-Id: <20181218063911.2112-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181218063911.2112-1-richard.henderson@linaro.org> References: <20181218063911.2112-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52b Subject: [Qemu-devel] [PATCH 22/34] 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: qemu-ppc@nongnu.org, mark.cave-ayland@ilande.co.uk, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/ppc/translate/vsx-impl.inc.c | 43 ++++++++++++----------------- 1 file changed, 17 insertions(+), 26 deletions(-) -- 2.17.2 Acked-by: David Gibson diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index 1608ad48b1..8ab1290026 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) { @@ -1214,40 +1219,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) \