From nobody Tue Oct 28 02:16:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516075119383269.5258076087281; Mon, 15 Jan 2018 19:58:39 -0800 (PST) Received: from localhost ([::1]:60228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebIOU-0000Fp-Np for importer@patchew.org; Mon, 15 Jan 2018 22:58:38 -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) 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) 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-Google-Smtp-Source: ACJfBovI2LTwE1lsP5v3nwZPBF88ISAI6alFWoqlFG4xanmvqeqSy38MCTzg238UH/6/y4G3jsHO3w== X-Received: by 10.84.218.11 with SMTP id q11mr5548869pli.207.1516073706316; Mon, 15 Jan 2018 19:35:06 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) 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, b= ool is_q, bool is_u, int size =3D 32 - clz32(immh) - 1; int immhb =3D immh << 3 | immb; int shift =3D immhb - (8 << size); - int dsize =3D 64; - int esize =3D 8 << size; - int elements =3D dsize/esize; - TCGv_i64 tcg_rn =3D new_tmp_a64(s); - TCGv_i64 tcg_rd =3D new_tmp_a64(s); - int i; + GVecGen2Fn *gvec_fn; =20 if (size >=3D 3) { unallocated_encoding(s); @@ -8721,18 +8716,18 @@ static void handle_vec_simd_wshli(DisasContext *s, = bool is_q, bool is_u, return; } =20 - /* For the LL variants the store is larger than the load, - * so if rd =3D=3D 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 =3D 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 =3D is_q ? tcg_gen_gvec_extuh : tcg_gen_gvec_extul; + } else { + gvec_fn =3D 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); } =20 /* SHRN/RSHRN - Shift right with narrowing (and potential rounding) */ --=20 2.14.3