From nobody Wed Feb 11 02:13:35 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=1567019966; cv=none; d=zoho.com; s=zohoarc; b=X7yZMJx91s4L2Nwya4qcGu8/bZu2ip0PFWaSzDD1oLvspMLZYBn82KNXVgdQd0wIVU5UJV3xXbyfUhbvoZSfsIrG6N8eh5vju89VG6mGhZF2KgmEwPm1yyJXGDrs7x8+DgrpczV84YI9aey21se9kpYkHlv+TFMYjqNDX7b+uAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567019966; 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=XK0pfbS5nVG6fwyWU5L/Wqmb0aEonSQXz/8cuqg+DQA=; b=Li/ehgNFw4xAeAIercqU4dKSbdXpyuFCJNUKBGqBvKqtOYvwuT2a90hPI8Gy3Jn4YbjqlQ7CvhUTdcrP7hbCPgGhp2Fev0SsVAej+wxR/G1OU7z/xcGoEOEqR/MjZbWs464YkhOimw8jlLQ28JkUp0PS4cF98eNPhH6t06LPyO0= 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 15670199668761015.5437289960985; Wed, 28 Aug 2019 12:19:26 -0700 (PDT) Received: from localhost ([::1]:41080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33TW-0007Tr-QW for importer@patchew.org; Wed, 28 Aug 2019 15:19:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37592) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33Ft-00039r-6R for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i33Fr-0008KI-CO for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:05:16 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:39426) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i33Fr-0008JT-1G for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:05:15 -0400 Received: by mail-pf1-x444.google.com with SMTP id y200so389279pfb.6 for ; Wed, 28 Aug 2019 12:05:14 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id f27sm2967944pgm.60.2019.08.28.12.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2019 12:05: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=XK0pfbS5nVG6fwyWU5L/Wqmb0aEonSQXz/8cuqg+DQA=; b=feOtS/ZqFlgBkJZ5pdTynYGbMfBpLK0CfrWpuWVF9HIw+VTK/yoKK9RpuibcvLQqx3 q5OUGEyPoH0zjc4pJQa/otLTy951BOV5GVXbq/8iMZ/aS/ad7L6/U+yvTr0IzbXpKHJh vgP1DgHnYRmb+bMyY9763H/UCKW0jKTx4IHRmeYRIZg7i1fBnpC9lj2+fywG19R/MJP8 g96AMqPv6oM6gTcXiLkIZjaDS6up0+EpDLWakz+XauTQ1nOSzRQPZ1XmuHGXhobFkgNp b7mzL3VgbLHQ0aMzkCH1aQorwt4fJ5pJTgLT3utQlC0JaKyzSQRenRhNsMAQqlySOGKB /gtQ== 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=XK0pfbS5nVG6fwyWU5L/Wqmb0aEonSQXz/8cuqg+DQA=; b=cynBdTFrgoA18F/RbUSIfg6ZxYGhoPMyCy971FRpmu8vscwX1Y7zSphXIlVXFwMcd7 ULID881FQSFCAQYZoO2+D+Xdl3hFIW7X7AhBYo3P8oG/LMys9elCPJD56TJ4UtPf+nMu SF6Fb8t35TtYcwfzJp2KQGnSGQusAfjLACUL1Fn/S/lTbgkN/yY2XfH47vQxXuWWT4Ch +z8H4EEXTBVfFN4Gpwy2ztAIKLy1jipy9+CRhJ4WRemOOFV+aHhwhpE11RpkspaCW3Kn 3YsIkB7tkC9YQcxQBROGz5/CDVATFJoQNHDxDORBdPitStk+BGsKyhoYDT/ts2HUpR3M JL3w== X-Gm-Message-State: APjAAAXNasw7Fcpg2WvfSqGuIiDTfHhfOXAc5kaUfzzDZxd26C6AlWQr 55pV8BFMjpBzunwpaPIrxHiumMY6Nng= X-Google-Smtp-Source: APXvYqw6sI8uYpfFUoGwZx1M6jOJNvEIE5BAY3VhloQC5D0dzVats6JLgjLFm0Zk1UXE0xn5QXUXjg== X-Received: by 2002:a63:607:: with SMTP id 7mr4768185pgg.240.1567019113050; Wed, 28 Aug 2019 12:05:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 28 Aug 2019 12:03:58 -0700 Message-Id: <20190828190456.30315-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190828190456.30315-1-richard.henderson@linaro.org> References: <20190828190456.30315-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::444 Subject: [Qemu-devel] [PATCH v3 11/69] 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- 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 8813d40a2c..fad07499d2 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8216,7 +8216,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; @@ -8224,16 +8223,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