From patchwork Sat Jan 6 03:13:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 123620 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp132614qgn; Fri, 5 Jan 2018 19:31:38 -0800 (PST) X-Google-Smtp-Source: ACJfBoszXaamXVHyhWnchvCuzAz19braQnlIHpqcqWBAoy1Y/a/ra7SiYySWaDY0ODyWgYsWipS+ X-Received: by 10.129.78.82 with SMTP id c79mr4756092ywb.509.1515209498318; Fri, 05 Jan 2018 19:31:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515209498; cv=none; d=google.com; s=arc-20160816; b=t6UT4brgc7fPbIcu0x9TbTMRe1miobWFRleSNudbf1wO6IkMFU/v26mK1H4lQ381Mj x/qtZz+BsFbZRLGLcw3TWkPXEVdkYxbKYNX3WkFBI6VTV13FaNi2iu1mCeiDU6yr+unu doJQLucSIFDC87DIZtRAqbTxoEHXIW2LKWbLMj7vCyxomPABBfdeX2rrjcH0wXvcLnT2 Qqb//OkOh9+Mprwc0f3NDYZuCYinLCasUU7NIlaSt4nF5yUtzf7tNzsy5c+qyNb0HTws AaHdZ/InOW4sAp8Fc+c/Fpn7wWc/aQ2hQY2JXitkT2cbamBbVrrvxYVnGHsuuqnpgQ8z lx0w== 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=Mxo+uP67WSswZbYohOYvV1sBdXZaULpKkE4loDG62vs=; b=pvMqj8I+SKYjHHtdBqpCkOT/5lF5LaJQvNGlpby2aKCncbsJLcD/sh2YuJ03QXR4Bw Spqgw35d2KUSjYaYmKFCsOC7pa3xhEXw6cJwofZxdD7ttjyHXW8vMJD2+ve5R9urHfED Xyu8aU8NjjbSMEDpQmSouRGWNJCISg6TOtco5x4HJ3I9nRzDFiuh7YWprp3lN3m3rlCO mB41fa8eYouGfmZsw24Cxm+QZpdyqbXc54UEEp44Zraxq7gSgUiUc3Qb+Z6lWfYG4sok T+XGayUd1iSYk+9BhhfgglR6/aDvh6iDOBppGzY4+ehigwSq7uuuBlZjT1U6iCCuFtad VjpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EdEUfyeP; 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 q65si1481412ywf.528.2018.01.05.19.31.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Jan 2018 19:31:38 -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=EdEUfyeP; 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]:44313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXfCr-0005In-TL for patch@linaro.org; Fri, 05 Jan 2018 22:31:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXewD-0007mR-4k for qemu-devel@nongnu.org; Fri, 05 Jan 2018 22:14:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXewC-0005ml-5K for qemu-devel@nongnu.org; Fri, 05 Jan 2018 22:14:25 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:42486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXewB-0005l6-Vh for qemu-devel@nongnu.org; Fri, 05 Jan 2018 22:14:24 -0500 Received: by mail-pg0-x241.google.com with SMTP id q67so2709803pga.9 for ; Fri, 05 Jan 2018 19:14:23 -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=Mxo+uP67WSswZbYohOYvV1sBdXZaULpKkE4loDG62vs=; b=EdEUfyePa0L9ieIJSvNCusBtoOKI8KAIVb+GuTF6nTE+22+fkP0kXiocKJ6c5/CpzU cGCnNVmcKIk5gMKTMIk1FB68oksNbqzCGEHA8wPJJsKnyaC0B6gWkQKFDjTbaDNMGRqO dxsiS/+BnzzO9shhQthI0+COWk/BFgfIZRAFg= 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=Mxo+uP67WSswZbYohOYvV1sBdXZaULpKkE4loDG62vs=; b=peYpY/HCwtH9qS28Dd491k+FXI9s+ub/ButttO+X7/6+LsBoOGYLudHtTFD0GVTkYV 3dic6+Q0jZ5i4Dq5B3oQBZSkVM0NzEf6w5eCwjEm695cSTwFyz5JD1GNK1S/OmCnjGWM cOaEJa7CELSFE5NvehgmbqJvLWPMHaLLLToxp7RXUCBvGrFb+hZjbZ1DeK0sJ5LGonbN h+jWVS+8wODXsb3kAc27WK12u2qm6T2x5Ne5w1ZnO4ReZIi/30UHobjqqmT7de0oh2wt rIYrMric1/IZ2LVsBPxEYthfDZ8PQt34bP7rJIp0A+yEVWjUyqAXnqkmL2Wt0X9Vz6jR PZMg== X-Gm-Message-State: AKGB3mKgkJ6MSI2p/gTbQzSyfYtnxi8rbG77B1lOrmmKBdcP5VsGP23d 2lcT2KxojlzyWPY8XkgNMw6ZyYQRruQ= X-Received: by 10.99.99.131 with SMTP id x125mr3459910pgb.110.1515208462777; Fri, 05 Jan 2018 19:14:22 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-183-164.tukw.qwest.net. [97.113.183.164]) by smtp.gmail.com with ESMTPSA id g10sm17740595pfe.77.2018.01.05.19.14.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2018 19:14:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 5 Jan 2018 19:13:44 -0800 Message-Id: <20180106031346.6650-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180106031346.6650-1-richard.henderson@linaro.org> References: <20180106031346.6650-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:c05::241 Subject: [Qemu-devel] [PATCH v8 21/23] 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.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) */