From patchwork Tue Nov 21 21:25:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 119422 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5824732qgn; Tue, 21 Nov 2017 13:42:47 -0800 (PST) X-Google-Smtp-Source: AGs4zMa0N/J1G45qYEN9uPJJ27Ad9A0PEpSeWa6LeWtl4DLuqNft71kH/1Xw30V5SvQ6SQPUFZnw X-Received: by 10.129.118.17 with SMTP id r17mr12604156ywc.497.1511300567432; Tue, 21 Nov 2017 13:42:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511300567; cv=none; d=google.com; s=arc-20160816; b=t9cjJdU7/SzUADv7wLu5tge97vD3prZdftGQ9OVFKJ9Ul87+3LJBN8MvgQT1lyJS24 ZDhslMDCYm5v/ix8nkbRxeP8mj8s4mLf1OwKfIXXND5mADizI+iWVm1AmHBvtzsnwLXE jTfwg2Rk0erbcmglLIxKmDKUTcIAOiiQ/29odvp3Sxo9wJRkcfcAIdrbQyIRbOSXo4JU 6qhLC4vmJjSGgp3Fia6ENVBeoYKtj/CtKuOEdWNYN2HfBB5RDyElF82lVPZWAu0CJ4xp FCwVS75i1s4i8jbQXe5ygUDviHQ4yPW5nUJCpJL5+GZiZM9pOSZKDOYepZBSV/t83ebG zdhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=UfWLBriMEwBCkjQxTbR502Q73I7ejTcSkyhpjba8iuA=; b=DBtwuEqk6osp+V5Fp5qMRhK4FIsO/61gYpwotd0FVya3OT9KOxHSdO3rlsWRMyVe0U R6LzzkxfG+ah91It94P5U9He4ESsKFZUsyf+3nTVZlgvxQRyGXu65+/IMFlNrRxrG4im 2L24xhEs+48PX3U1Xe9Pa2vl7PS4Tqy+vh853mAB2HI88GaOKV0TFMRHYUB0quxxkbZ3 EJOsN2sBlSf691WcBmmVhAz+TY72y1Z09G5TZw0pXQsEog4Me2GopZMrwMLHaA26dcbp XWQxfFGfoEIMwhnM8PEZNDCjw94njCuGOo+klHW4rWwHbgoQprPCew0Ou247DLAE/0Jz RDgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PYVZ553Z; 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 j17si2962009ybm.170.2017.11.21.13.42.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:42:47 -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=PYVZ553Z; 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]:36651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHGJa-0008D6-R1 for patch@linaro.org; Tue, 21 Nov 2017 16:42:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHG5R-0004gB-6d for qemu-devel@nongnu.org; Tue, 21 Nov 2017 16:28:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHG5Q-0007qx-94 for qemu-devel@nongnu.org; Tue, 21 Nov 2017 16:28:09 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:34090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHG5Q-0007qm-13 for qemu-devel@nongnu.org; Tue, 21 Nov 2017 16:28:08 -0500 Received: by mail-wr0-x244.google.com with SMTP id k18so7664007wre.1 for ; Tue, 21 Nov 2017 13:28:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=UfWLBriMEwBCkjQxTbR502Q73I7ejTcSkyhpjba8iuA=; b=PYVZ553Z7NWoK/QYwEUstXrN8JyPykS6PLa+BlRvrpsx1xTA0KjLESuyw+wJCdBmij Up9zjUpwp0aA9TDvilXlhP040cSN8cuskguFz07hkQ2oG9pTlRY87JDKzYNcL4rx6bBs c8+5dCqWj/jxOpPmFTu8HvRmJkyeogEKZDl6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=UfWLBriMEwBCkjQxTbR502Q73I7ejTcSkyhpjba8iuA=; b=J8eCicVjFmg5yw8nn0jqWfFE1sUUdW+Yo2FrI4Jf2z4iLQLMN0mRteEmWP+nu8qIyZ LXESAhhKu3xUJBh0rANEW0qD8DruxkcQfOeCswsMvdSwFika2Kgv3gjmMqFMPDLY6Jir fPNfgq3LGCubJ5K6kuRSq+M2I0xh7KI9ZJuGpydPmlQOceO4df3QvEpaVqpy2ZyN+lE/ AF7R1JbzbEpdZJB9bTtnfNrb9VtYyETIHMVPhHMBJMH1a+tqZHCmUVIuPt9S572sAF77 ldyV9alrDLg8Jc+KSqJd44lw/GMc6AJFQZHuk8px6HLrrpNt6WwZFdEQmxHstIWpIHCO nfhQ== X-Gm-Message-State: AJaThX7yYucs2KFii9dRnj3vERJ1fiD5AykL7K9XTxUHDgTbpkeUZiQp 2XnyQOpQuZfAqTiuCT5XdCGThfFyH/I= X-Received: by 10.223.142.143 with SMTP id q15mr10089196wrb.6.1511299686836; Tue, 21 Nov 2017 13:28:06 -0800 (PST) Received: from cloudburst.twiddle.net (70.red-37-158-60.dynamicip.rima-tde.net. [37.158.60.70]) by smtp.gmail.com with ESMTPSA id e124sm706517wmg.34.2017.11.21.13.28.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Nov 2017 13:28:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 21 Nov 2017 22:25:32 +0100 Message-Id: <20171121212534.5177-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171121212534.5177-1-richard.henderson@linaro.org> References: <20171121212534.5177-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH v6 24/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: , 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.13.6 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index c47d9caa49..1f7e9c4e19 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) */