From patchwork Mon Dec 18 17:17:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 122251 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3108933qgn; Mon, 18 Dec 2017 09:27:51 -0800 (PST) X-Google-Smtp-Source: ACJfBovip8J4SxhxPdzGsW7EkHy+mIfWVHrYf985nVhboX3Wk02NVPG/SMMgn0+35qkXEw2SOVf+ X-Received: by 10.37.239.69 with SMTP id w5mr448360ybm.31.1513618071136; Mon, 18 Dec 2017 09:27:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513618071; cv=none; d=google.com; s=arc-20160816; b=kc200ONFsNvtpWYmD+1t7QP1qDrTqzXHDQ9K3m6k29sL7iiJZ33905juVoHUUGfeku 57s4x1rwPyEhG+xNPWHDmKaLuuQrjLpJauPt2PDOJtHHDOaZOHu+/YXPIPy+FGz0rLpV EI4uW4uQ/E2LbJCm/4w4zXUX6SfiyM/TskxY2rs4Xe7uj4HmVvuAB0e4w+CHvoY79YoP Wz5m26QHOI/IqUHjn8TFgN4jeiWxYne/SJbiUPqyMs8bjdRZiicIRjfa2ggsPPHDkUoY CyVbZiIBvzNl8oBRsr4IrtnMH/qD5nio7dXDTYI9sqrYDsacClbJ0Q5TV5cFeG022xOD 3jnA== 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:arc-authentication-results; bh=acxGEq2fNn/6enx58EagUxLLjzbVqjr4Z7gQAnNLh/k=; b=wnXcYFr5v0xp5iUCWMFSLq+5spcuGnLxBu2sWjgKFaW7NMsDXHWtwH84fg1ry7z0ji fR3YKq/sviVWcOr4ZGOb0irzkBLnrnr/RLen2KF6hemqoqfByUTWZUeSYONgCmqMLY7j o2X0stENxM47Z/39ZNbTUIK0AKO5r/DBtSxSSXHuZsJKUFH3CvFNq8JfKdLmS5Lty+M5 FwnH85X0vwLUuNXwfKHUHDJ+vHlBXd3+lsGUX5I5RS6qDhBacNEQVhSTg7qhpTT7l3TU nDW/GRUXXRWjqJf+Lj9qawlGYZHUh8xdUTjrtY0k7TIpV3VJWYbHCBWmpqIXqp64nDka 5Xsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dAbs6SAN; 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 y4si2491512ybj.405.2017.12.18.09.27.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Dec 2017 09:27:51 -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=dAbs6SAN; 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]:58577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQzCg-0007XA-HS for patch@linaro.org; Mon, 18 Dec 2017 12:27:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQz3R-0000Mh-Hp for qemu-devel@nongnu.org; Mon, 18 Dec 2017 12:18:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQz3L-0000tp-RF for qemu-devel@nongnu.org; Mon, 18 Dec 2017 12:18:17 -0500 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:34425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQz3L-0000sH-Gx for qemu-devel@nongnu.org; Mon, 18 Dec 2017 12:18:11 -0500 Received: by mail-pl0-x244.google.com with SMTP id d21so5189300pll.1 for ; Mon, 18 Dec 2017 09:18:11 -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=acxGEq2fNn/6enx58EagUxLLjzbVqjr4Z7gQAnNLh/k=; b=dAbs6SANMDf82UMcx1CQvLrlSANGDNPX+KbD8UMGYM6rDsKYQBVE0zYRh8OrlX1Mak yMXwKlAL4t2yPGH7hZ4fHA8h5/ZmHgZc6CcDoJyS6gdIem0MArSpUQhPMSQmOxHmqU4k HLcui8wi6e9a0IGVVZ9y5y6MM2/qfb64o0lLg= 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=acxGEq2fNn/6enx58EagUxLLjzbVqjr4Z7gQAnNLh/k=; b=UOq4xqnyg7jyt1kwMevr7S0ccpuI/Aq2hgfjUMWvOYBffSsGdIhiuGF+axaB2tzkqs 3tEpYefJ2pcEOhh9N8lvy2VpoywmvzOvTwAfwy1OXNtCZ7fimlKSw4GFleafB5oR1Gh3 3dXhZ2JTUjo1vmUbSkggI8QD6hTxKHQmzjC/kom7f2WpRHEjNYPcbOD+ToM9iqgQxFhx 15tmB9EZdgPKxDtaoO6KIyhKhhjXukyBL9acAUnhzgejF7K33eMzY0iVkNCgXPaLfHQC TzsUd/PIJaatlE0GiusebNWtyU3gkZ6P+qgg+VagrijU2SyjjgSymydt/RbeejXdgiER wzOw== X-Gm-Message-State: AKGB3mKtBC22eYf+nirVfKs+qFgU78K9NKt8E3Mvy38dU+mVaM5Z2nIE vFOynSHccUnoVhUUFX5K2gVkdaeLnp0= X-Received: by 10.84.224.75 with SMTP id a11mr369900plt.421.1513617490188; Mon, 18 Dec 2017 09:18:10 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-7-63.tukw.qwest.net. [174.21.7.63]) by smtp.gmail.com with ESMTPSA id y19sm21050272pgv.19.2017.12.18.09.18.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Dec 2017 09:18:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 18 Dec 2017 09:17:38 -0800 Message-Id: <20171218171758.16964-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171218171758.16964-1-richard.henderson@linaro.org> References: <20171218171758.16964-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH v7 06/26] target/arm: Use vector infrastructure for aa64 mov/not/neg 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) -- 2.14.3 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 572af456d1..bc14c28e71 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -85,6 +85,7 @@ typedef void CryptoTwoOpEnvFn(TCGv_ptr, TCGv_i32, TCGv_i32); typedef void CryptoThreeOpEnvFn(TCGv_ptr, TCGv_i32, TCGv_i32, TCGv_i32); /* Note that the gvec expanders operate on offsets + sizes. */ +typedef void GVecGen2Fn(unsigned, uint32_t, uint32_t, uint32_t, uint32_t); typedef void GVecGen3Fn(unsigned, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); @@ -4579,14 +4580,19 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) TCGv_i64 tcg_op; TCGv_i64 tcg_res; + switch (opcode) { + case 0x0: /* FMOV */ + tcg_gen_gvec_mov(0, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + 8, vec_full_reg_size(s)); + return; + } + fpst = get_fpstatus_ptr(); tcg_op = read_fp_dreg(s, rn); tcg_res = tcg_temp_new_i64(); switch (opcode) { - case 0x0: /* FMOV */ - tcg_gen_mov_i64(tcg_res, tcg_op); - break; case 0x1: /* FABS */ gen_helper_vfp_absd(tcg_res, tcg_op); break; @@ -9153,6 +9159,12 @@ static void disas_simd_3same_logic(DisasContext *s, uint32_t insn) gvec_fn = tcg_gen_gvec_andc; goto do_fn; case 2: /* ORR */ + if (rn == rm) { /* MOV */ + tcg_gen_gvec_mov(0, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + is_q ? 16 : 8, vec_full_reg_size(s)); + return; + } gvec_fn = tcg_gen_gvec_or; goto do_fn; case 3: /* ORN */ @@ -10032,6 +10044,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) int rmode = -1; TCGv_i32 tcg_rmode; TCGv_ptr tcg_fpstatus; + GVecGen2Fn *gvec_fn; switch (opcode) { case 0x0: /* REV64, REV32 */ @@ -10040,8 +10053,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) return; case 0x5: /* CNT, NOT, RBIT */ if (u && size == 0) { - /* NOT: adjust size so we can use the 64-bits-at-a-time loop. */ - size = 3; + /* NOT */ break; } else if (u && size == 1) { /* RBIT */ @@ -10293,6 +10305,27 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) tcg_rmode = NULL; } + switch (opcode) { + case 0x5: + if (u && size == 0) { /* NOT */ + gvec_fn = tcg_gen_gvec_not; + goto do_fn; + } + break; + case 0xb: + if (u) { /* NEG */ + gvec_fn = tcg_gen_gvec_neg; + goto do_fn; + } + break; + + do_fn: + gvec_fn(size, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + is_q ? 16 : 8, vec_full_reg_size(s)); + return; + } + if (size == 3) { /* All 64-bit element operations can be shared with scalar 2misc */ int pass;