From nobody Tue Feb 10 02:00:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1566251339; cv=none; d=zoho.com; s=zohoarc; b=BR562L1rHnozXjVHSx7JPTfa5JCkAol3ybUMPzjoSOCZ8STdv4xRuS+Vp61yZ6bZQ5N9DgIvWhdxWIRP+M4LRJvhr1D1tKTGH/ksOu90zu9fTodyYOK9jGBwdPI57BvtHXf2PBZrX7Fa/JR6bNhHIMl/5MUb+wDUc6Rp+Zf6w/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566251339; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=z6bTZIJUuD2Rb2udZZO8tN325lpohcam+cQYkXY7q0k=; b=QZPlzILSGPCKJpL1vULWHACDkryTWEOJmYgGtYlubYqZUM2hgk/IrJw1z+S/4agI1b15kT8WgzB033t108JGi1d4lmTSJoVQq5flf6+TiJ4s7at3OstgSX7nO31pMvF4NfAiqFS/ZygNyhQFnP/e9SKwgzhX1HOsF71e3qE8X4E= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566251339265668.6256703753938; Mon, 19 Aug 2019 14:48:59 -0700 (PDT) Received: from localhost ([::1]:59070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpWJ-0004v9-CD for importer@patchew.org; Mon, 19 Aug 2019 17:48:55 -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) 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) 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-Google-Smtp-Source: APXvYqyTYPGYlGAlcPRyoPxB0CQOmFFZxh4s4C8Ae2V3wGwXug6GCI5bSU+JZSCR1Ghwu10OTGhz0w== X-Received: by 2002:a17:902:3003:: with SMTP id u3mr10413251plb.161.1566250691131; Mon, 19 Aug 2019 14:38:11 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Peter Maydell --- target/arm/translate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; =20 if (!ENABLE_ARCH_5TE) { return false; @@ -8221,16 +8220,17 @@ static bool op_smlawx(DisasContext *s, arg_rrrr *a,= bool add, bool mt) =20 t0 =3D load_reg(s, a->rn); t1 =3D 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 =3D gen_muls_i64_i32(t0, t1); - tcg_gen_shri_i64(t64, t64, 16); - t1 =3D 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 =3D load_reg(s, a->ra); gen_helper_add_setq(t1, cpu_env, t1, t0); --=20 2.17.1