From patchwork Mon Aug 19 21:36:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171671 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3534952ily; Mon, 19 Aug 2019 14:46:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqypOKQZNHQKWS5SWYGB2k3CMbTw3HtYCE2FXRMUo7eVNK7BeV+N45YaAZBfiPv/pV8Nh3ur X-Received: by 2002:a0c:e64d:: with SMTP id c13mr12379140qvn.80.1566251163583; Mon, 19 Aug 2019 14:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566251163; cv=none; d=google.com; s=arc-20160816; b=VHJsvJZ6l7CL1351Mi8Wri5dQ2yFcuswVFs1JLCPaJgAehK3VuDrB6YcpzZDOL5tQt HRv4rQCNNgz5Ure6CO/Y4I+5zIjwhk1y3ziNlZnrKpL1nrFdFhzxpLlRXh6ftllEGXWN w8pJkSjt52WCC/WSbAztbTn/lj1Z+H+qLBg630rN0XukgeBfEEQTZvCAsmGLS0w0Bix3 N6gfZV2/8oytGEiWLv0NsJIZChLBsAVtfSNXszfXdeVYiX7+0yAoDgI14LifEfZFcPpz adr84IOLFiKVyATHrai7lzGX8v20bXem1l5UZK3gklY21BKVNCkw/vRL76wb66izdKd3 k+aA== 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; bh=z6bTZIJUuD2Rb2udZZO8tN325lpohcam+cQYkXY7q0k=; b=U3NTIGy4cKa149vxGy/Vgz67sCtj1PwG1qqOW4ziJL3OIkl0w7L0jkXHVzNffC5pfd eGFmKz0BVuwBwqfEl+ikHnRTvsGQ+dxMF94kKI21nGfNr4qKBUNg+ffxpmOUs0NNCbGQ fFVcbhY2PVh7HJPoHSNhsJi1gQHbH8nqHIFHWrJQe2ZwiH8qe26Rx6BmxR8zFGpGTRZa WbQTiVf+maKCJnXsuVDXjFjBt+9Qe300OzOyV1znF9OC8Qst0loYYOBRXe2fTvYHKzgA ZKzvmPGYN0QBgNCVqaWIOuw1mHLrY5pAGkhiSYJsLpGRg9+xrxcm+33f1WA2Y6RKnmVl jeEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YZ0YyngK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id j12si9250538qkm.62.2019.08.19.14.46.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 14:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YZ0YyngK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:59040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpTW-0003Di-HR for patch@linaro.org; Mon, 19 Aug 2019 17:46:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58699) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpLx-0001SK-Gi for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpLw-00065V-G1 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:13 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:44256) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpLw-00064r-AQ for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:12 -0400 Received: by mail-pl1-x644.google.com with SMTP id t14so1574161plr.11 for ; Mon, 19 Aug 2019 14:38:12 -0700 (PDT) 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=z6bTZIJUuD2Rb2udZZO8tN325lpohcam+cQYkXY7q0k=; b=YZ0YyngK2P7R9z4uAceUFNeutCFwqq8i7vHldiAteQsa2asCHVcg48IqB0ep869q68 WLkmJMH3d9AIM/6t3LdqVsLoNan6DkrZ5bP5w0oWMU9dNJPzn0NceZRiJkn4fA0W7t9O VqGnq6tJFsJS8yAZTutn/9id0o2UvV7gLg5w24eEoXo/Jaw2B3RUlETz/b3mgkiUIkxg Pv5V2nc0CJZfig4FPjVa19zF7nxIaNayil+c2ucKqFf2SsqmklGyNSqj/u31Vw2DtjFt /YBMIXkSMJbhGIqqXP9cCMh7cdqcTG+K4swU2m2hb3JeyKUGvsFG18f0v96DbKCu8d0d DOEg== 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=z6bTZIJUuD2Rb2udZZO8tN325lpohcam+cQYkXY7q0k=; b=pAdooXmFRoVzrJPCPA4k2IPzRX/os6veXer/mlCrVKRe1o0trvFtAZ5Ko3+rq5G1De hpdpfCdGsi7A+7T0oGg3A9LqNcInL8yC87sNIvSgubxgbCz9DaEqprUyKvbZMfzyOAwe rN2hD2uV596eeGCOhZ5EYJRy97sM65BdLGyV7Hl383WeXnRt8UzW2SXQHbkR/pcP4RLO 6EUWxWB3fnMw4NNqhlEa3UHETf3ZWzx9MZaj7Hjtc/HRtIgGrPes9KWB/t7ZVZiIkSYW CgIHY7cgyLwDAvDQ2/6UIR3A3a1p09a/tbWfj8G19uIjI8mO9RGx6DA7gkrxzUiv1IGS ckzA== X-Gm-Message-State: APjAAAVGxeiyUXgQyOcdiqRRQHxh57ivTWK/BRBzNCx7NgbyVh2Q4XzU B6Vj3dttotHbezY4P6W7bp0qAd2Zw/A= X-Received: by 2002:a17:902:3003:: with SMTP id u3mr10413251plb.161.1566250691131; Mon, 19 Aug 2019 14:38:11 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id d2sm13446951pjs.21.2019.08.19.14.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:38:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:36:58 -0700 Message-Id: <20190819213755.26175-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190819213755.26175-1-richard.henderson@linaro.org> References: <20190819213755.26175-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [PATCH v2 11/68] target/arm: Simplify op_smlawx for SMLAW* X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" By shifting the 16-bit input left by 16, we can align the desired portion of the 48-bit product and use tcg_gen_muls2_i32. Signed-off-by: Richard Henderson --- target/arm/translate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 8557ef831f..9a2fb7d3aa 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8213,7 +8213,6 @@ DO_SMLAX(SMLALTT, 2, 1, 1) static bool op_smlawx(DisasContext *s, arg_rrrr *a, bool add, bool mt) { TCGv_i32 t0, t1; - TCGv_i64 t64; if (!ENABLE_ARCH_5TE) { return false; @@ -8221,16 +8220,17 @@ static bool op_smlawx(DisasContext *s, arg_rrrr *a, bool add, bool mt) t0 = load_reg(s, a->rn); t1 = load_reg(s, a->rm); + /* + * Since the nominal result is product<47:16>, shift the 16-bit + * input up by 16 bits, so that the result is at product<63:32>. + */ if (mt) { - tcg_gen_sari_i32(t1, t1, 16); + tcg_gen_andi_i32(t1, t1, 0xffff0000); } else { - gen_sxth(t1); + tcg_gen_shli_i32(t1, t1, 16); } - t64 = gen_muls_i64_i32(t0, t1); - tcg_gen_shri_i64(t64, t64, 16); - t1 = tcg_temp_new_i32(); - tcg_gen_extrl_i64_i32(t1, t64); - tcg_temp_free_i64(t64); + tcg_gen_muls2_i32(t0, t1, t0, t1); + tcg_temp_free_i32(t0); if (add) { t0 = load_reg(s, a->ra); gen_helper_add_setq(t1, cpu_env, t1, t0);