From patchwork Tue Jan 16 03:34:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 124606 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp880074lje; Mon, 15 Jan 2018 19:59:00 -0800 (PST) X-Google-Smtp-Source: ACJfBoty4XoeOCgWhzn+uEdUOOfQ5ZvxQZRT+WdlFxxJwQmAje6BjE9Xvkzh25+b2UGPA1xebmVi X-Received: by 10.37.174.16 with SMTP id a16mr6109047ybj.53.1516075140564; Mon, 15 Jan 2018 19:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516075140; cv=none; d=google.com; s=arc-20160816; b=UQ6GOTpClvafYtpUvCBk9raHbEEttkula63dnvn0BEJ3Omb/4fKruH4L7W2pnDm4rM k4tl7iqPQ2CanUqXZtvs4v80ddVc+K8glS59ET1nk7Rvk3X6ROwv5MAHmLvD1OjCYb3X uvktWu7xZyKpZbIsrpuXia6nCicjBGdgKKY9XfpRg3Seo8+0p83u4Luow7Nt7S1/fAMv w/l8viq8T2eXXNbhePcnbF0j8T9z8t2qIi2kouIlQAfjYr5RXTD2XvwLRYzAbW1q/pO9 jeHtFFqetRIotDKMqnSsqRI7639T+JaZsvjTkN27uRGdb2wM2OJjJobKZ51cErEmvxZh xMLw== 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=Mxo+uP67WSswZbYohOYvV1sBdXZaULpKkE4loDG62vs=; b=03pZKiHqwbvChZuyOrlyGYn64bZ/jWzCYTK4Fv4MXkMQvnsSoeb+DRLG5Sf2Jm+m8n amSita1DpvFaUEfeAGFQZtygEJWu7RbytDVI95bqpC6j5Dmse9vnM/xCXRvBAABIO1au ZZ8b914is10KrQ3wf2d+kiQ+7JYN3Ezm7qMdgOV08xouQ1BMngFJs4q+QSYcySGQVubf zoIPwr7Jc1P78K5iOKEK0O4uTqQxGf+E+5VoAk8INeagpNPItccsC249Aw0IqRMvNSKl IhIkjVu1TW8eu3cFSLWcj2UmOmaqGavaSibqw8bXq28+BX2yH8JY3VLIdqoc1SmsmLrP cNeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jCiREoEl; 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 n2si296141ybn.509.2018.01.15.19.59.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 15 Jan 2018 19:59:00 -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=jCiREoEl; 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]:60228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebIOq-0000Fp-2c for patch@linaro.org; Mon, 15 Jan 2018 22:59:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebI1l-0005XN-1Z for qemu-devel@nongnu.org; Mon, 15 Jan 2018 22:35:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebI1j-0003So-ON for qemu-devel@nongnu.org; Mon, 15 Jan 2018 22:35:09 -0500 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:39948) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebI1j-0003SO-IV for qemu-devel@nongnu.org; Mon, 15 Jan 2018 22:35:07 -0500 Received: by mail-pl0-x244.google.com with SMTP id 62so5125780pld.7 for ; Mon, 15 Jan 2018 19:35:07 -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=Mxo+uP67WSswZbYohOYvV1sBdXZaULpKkE4loDG62vs=; b=jCiREoElNkirfEMqx0Jh6R7DEGdwD8ktWqBZ9+EkypJPrXjIhBW79w/wFguwRmy8ii 3fYLEp95vNi/E73IaB37FMVOibS+4YCNhPdDERipHFnzSq6nIY92Uo9QnhyQVbGsNBRK lnrGwpJnMeJM3J1n/4nFUVR2trgacBSaNwU6s= 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=Mxo+uP67WSswZbYohOYvV1sBdXZaULpKkE4loDG62vs=; b=WZVm8/g+z9at186i5s2eRelJwf8Lp2qyhAbXfqTh0Gkbuca8Y6+7fRbZH7uoIdaWAV oFYy8K+P8bnLE9EOeQ+7yESdrIBRc1hrJoHyxxwYlZjWKFwB2KYZTmLaIQi+Gfw0W+R1 IeTWgawcL4K7fIyNKAhjH7HShtRV/wqJ2cNRyZp5vFULaEpr5Iir5gzWTSI6MbBrc0ih NRo3rlsBEnE8GbDSvIyQI3BQhhSp18PC3Rnduj9WMVXqSS5w/QDNkEIFvrKNF4EMZNzL PJtDG+LXNldwY+CCk4DBQ+N3QkpH2cTVveTJTJmMvEKEsXRZlGh5wHS81LGTH+slA4OU myIQ== X-Gm-Message-State: AKwxytfxsxOt5WaZRwWpb2ieycdH7bhMz3uy2bVSyLjLh7KdZOcaaZ4j gTEb2ioILRnw8hBcrJevt9PgG+JC+JE= X-Received: by 10.84.218.11 with SMTP id q11mr5548869pli.207.1516073706316; Mon, 15 Jan 2018 19:35:06 -0800 (PST) Received: from cloudburst.twiddle.net.com (24-181-135-57.dhcp.knwc.wa.charter.com. [24.181.135.57]) by smtp.gmail.com with ESMTPSA id c83sm1281024pfk.8.2018.01.15.19.35.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Jan 2018 19:35:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 15 Jan 2018 19:34:01 -0800 Message-Id: <20180116033404.31532-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180116033404.31532-1-richard.henderson@linaro.org> References: <20180116033404.31532-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 v9 23/26] target/arm: Use vector infrastructure for aa64 widening shifts 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 | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) -- 2.14.3 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 48caba3d9f..4f15e58556 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -8705,12 +8705,7 @@ static void handle_vec_simd_wshli(DisasContext *s, bool is_q, bool is_u, int size = 32 - clz32(immh) - 1; int immhb = immh << 3 | immb; int shift = immhb - (8 << size); - int dsize = 64; - int esize = 8 << size; - int elements = dsize/esize; - TCGv_i64 tcg_rn = new_tmp_a64(s); - TCGv_i64 tcg_rd = new_tmp_a64(s); - int i; + GVecGen2Fn *gvec_fn; if (size >= 3) { unallocated_encoding(s); @@ -8721,18 +8716,18 @@ static void handle_vec_simd_wshli(DisasContext *s, bool is_q, bool is_u, return; } - /* For the LL variants the store is larger than the load, - * so if rd == rn we would overwrite parts of our input. - * So load everything right now and use shifts in the main loop. - */ - read_vec_element(s, tcg_rn, rn, is_q ? 1 : 0, MO_64); - - for (i = 0; i < elements; i++) { - tcg_gen_shri_i64(tcg_rd, tcg_rn, i * esize); - ext_and_shift_reg(tcg_rd, tcg_rd, size | (!is_u << 2), 0); - tcg_gen_shli_i64(tcg_rd, tcg_rd, shift); - write_vec_element(s, tcg_rd, rd, i, size + 1); + if (is_u) { + gvec_fn = is_q ? tcg_gen_gvec_extuh : tcg_gen_gvec_extul; + } else { + gvec_fn = is_q ? tcg_gen_gvec_extsh : tcg_gen_gvec_extsl; } + gvec_fn(size, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), 16, 16); + + /* Perform the shift in the wider format. */ + tcg_gen_gvec_shli(size + 1, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rd), + 16, vec_full_reg_size(s), shift); } /* SHRN/RSHRN - Shift right with narrowing (and potential rounding) */