From patchwork Wed Aug 28 19:03: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: 172425 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1184129ily; Wed, 28 Aug 2019 12:18:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwa/jtN5RPOWxeQN3Fj1bIIXkjzpa7H/qNbxkj2oDlWz/sSTIef1CBJmBYwYm9y+HgHmvDR X-Received: by 2002:a17:906:4813:: with SMTP id w19mr4679416ejq.89.1567019897196; Wed, 28 Aug 2019 12:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567019897; cv=none; d=google.com; s=arc-20160816; b=ET5My9ftz2/p4S4se0pDWxcUip4Z4xYy3Nt+Fk67Xvk5ocDngBRGLFwbeh9jw6WibB AnFzbhzAJMtKZkMc+9NEelgShMbTkuT1dMM+RRwdlnkbqAOwBI+Nv7XnCjaiP8DuxyIj RVAaw24HCOXJv0Vf78iEsTU3nqCYJlwS2FpXh1UJaVZVKdsIHm+2do04/59EXjA8PaF1 N4ZAJAKYimTgBw0gf+fswlQB6ferQDzG2/7asPwafJgJ0MIQ+gkww1XkU6M1TVRm7G11 qPPRTBUz1atnhFM6AftjWRhKGVR6f6GJVguNKwLDGu9Q+ajPx/IYnOfSK83KnhpxpnJG +xQg== 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=XK0pfbS5nVG6fwyWU5L/Wqmb0aEonSQXz/8cuqg+DQA=; b=0++TX2mm8oClil8+m2R9DygBFKfYh08imJbi5RbKerF3ZoCFWv50RNkG3x4GGxtqvR 4y/AY9B4197wMZKfvAeNl5SQ6wgEiEIMz6mwkMI/qwtSRNFSof2e0PlIRtpUZgn4K2bt FJPICmtUCljfqbO0W0XOF9fIWRhS35pimhG8SJDIDEv7CANGROdgulJY8Ez//CXqVA0r NIKALVU780SvnW7FTF1Y2hPvNaFsYyHEXHZUUXW6NDAWR71W+fJrhjCyWiOvvMYghFPK oeGIz52dnPN9YUBFzlabG2Sl3c6qRg2YA07pVGkUNCQcsEE+JQXQs3QDEAHB7rrAgp56 cCKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="feOtS/Zq"; 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 d23si1716440ejb.149.2019.08.28.12.18.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Aug 2019 12:18:17 -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="feOtS/Zq"; 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]:41052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33SR-0005aE-JE for patch@linaro.org; Wed, 28 Aug 2019 15:18:15 -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) 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-Received: by 2002:a63:607:: with SMTP id 7mr4768185pgg.240.1567019113050; Wed, 28 Aug 2019 12:05:13 -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) 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+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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.17.1 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; if (!ENABLE_ARCH_5TE) { return false; @@ -8224,16 +8223,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);