From patchwork Tue Apr 11 01:04:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 672282 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp535444wrx; Mon, 10 Apr 2023 18:06:42 -0700 (PDT) X-Google-Smtp-Source: AKy350YgRMr11iyZiItb2FYSBvZGf6DAfnSnSg5JbmkjXmMbHox8r956pwpnsPlDvbB3c2sytcw9 X-Received: by 2002:a05:6214:e6c:b0:5ed:90ce:ef28 with SMTP id jz12-20020a0562140e6c00b005ed90ceef28mr8066606qvb.39.1681175202362; Mon, 10 Apr 2023 18:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681175202; cv=none; d=google.com; s=arc-20160816; b=zZPiat/nAJU6UGd2Y6V1rvjnuRf8n73TqdIbbnU26JuFQ66veOS3Rz7RthG/RL3o3y 9vlE58NXk7WCH7xffSoAdggmMcH/Je0E+LEVpHDP969dIAn/jY9iHaeI0eJ7yi/cQsHo ESjjjv/JV9HeEeBTu1yIrrQD5marwyHc4K2mJRa6U+tKQiMMUnDkUn/PV9evBXhttCZ/ K6iKGhbTL5a8relu5tjRM8yFiVj13NFguiO8n5eZcdXNAL11NBIX7XdVF7SIBA+OK1O1 XmMPY2uYdVQ0hktHBhzr1W4L72UvjRKZCkTs76IlMMtMCVVheDSZqmMpYvce38O4k05y AEfw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xzu39GMRV6RuI6NlIOVSyEEbNk34csPDYcvNvBnA8aU=; b=NNPhULvP1FH0t+c4d597wNvDmj6szKLZL+JawWzlBZhhYcY7oY+InHdaQbbLNebBcL uD2vOumPRi+QeDWIXrfDwm5aJloQv6i4RmgYogL9N3pE/RNoXKRJ1yHCki0pEnL2GOED pvjP/OjcRp7/nNnO64XkQgrXUKJycEmpvhcIccK618NrTRo8Or/OZPYhos66BKm5UCDQ 262ZxfF0WxKt9TDZHA711LpV/KRusF1VHFLWVLNJkOslNQ6mOUZTOur1z8TMOxXrLeLC jrc2rSJNZnBSh2ehpBkOum7Om3jf4HZr1NXtpdoWZoApRh7i2M4ZAUyn2OCQ9k+MW6Av KqtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hq5CkkXZ; 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=pass (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 a9-20020a056214062900b0056bf9b4f42fsi8160381qvx.390.2023.04.10.18.06.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Apr 2023 18:06:42 -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=pass header.i=@linaro.org header.s=google header.b=Hq5CkkXZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pm2S9-0004bb-RY; Mon, 10 Apr 2023 21:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pm2S7-0004ac-1u for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:05:43 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pm2S3-0000V5-S2 for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:05:42 -0400 Received: by mail-pl1-x632.google.com with SMTP id q2so11145078pll.7 for ; Mon, 10 Apr 2023 18:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681175139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xzu39GMRV6RuI6NlIOVSyEEbNk34csPDYcvNvBnA8aU=; b=Hq5CkkXZoAFqSpu8ZmaQ/Ye0y9GcB6NxkHRzmzCmNH1WILBy7J+5Ap9vBZEHw7ZQp7 apNQoOP7v+nCNGp8x9fGgezK4VTgbYleJ2U8ukz7Q2otNI2MLXk41d9PwtDR7G3MJlFN lM8v+Tw54jDWJTQIqsPOf6kiPAcb/O7dpF4BZGuDSZMEhAetdEgkvjgKbElimW6bmbuW 4mEY8EgiN/yK9a0KthM3uv9rgU5juW7G2ASa8JsbZP6EZpjWMzjqc/HaJ+zGYI+JGUM+ 1EHR25VJxR4T3dtFskOKSPeUgv1JQKA5StTKIxJ07lbQkPrX74UDTQqmBmFZ2Dpa1aY8 J+QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681175139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xzu39GMRV6RuI6NlIOVSyEEbNk34csPDYcvNvBnA8aU=; b=rgGkWNONeHz/jyIunYSES9IHTRFQNmm60pgnkiwBta6EyfE5luuhIQfRmob0ebJCpt ArjOBrouWdNtzASFAP99AShmGXxPfj7zIu9HjqltTRdcRDebE9T4nhL4p9+7Sls6veIu laK2oTn9vLtnCo/nhLLEDRQe1923b6v34QVkueRy9n/9iVbyMOsJ/lFL5LPl57HmbwxZ U25sj9PecUafZZuty+kJjYig50NT6a26Yo4WLVC63LPSELc1HKVAKRmIncUI9MIhazmW 9yvn1Ndkt9oVbEKr2uRjxSmCacbKTgNDedZJsV5uQgHtc8k3aMPzglFHwWoDpjRPJ9vT Z56Q== X-Gm-Message-State: AAQBX9eKDbly70yGTAWhBa7H40Np1C4eVske6elZw8KR15pw+LGt024x Rxiap+uqhClfg6ngEnXLgFxQUQct7VJ3kFeALsLyHQ== X-Received: by 2002:a05:6a20:8c16:b0:cd:f17:5292 with SMTP id j22-20020a056a208c1600b000cd0f175292mr11210826pzh.44.1681175138924; Mon, 10 Apr 2023 18:05:38 -0700 (PDT) Received: from stoup.WiFi.IPv4InfoBelow (h146.238.133.40.static.ip.windstream.net. [40.133.238.146]) by smtp.gmail.com with ESMTPSA id s10-20020a65690a000000b0051b0e564963sm1320291pgq.49.2023.04.10.18.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 18:05:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 10/54] tcg/loongarch64: Conditionalize tcg_out_exts_i32_i64 Date: Mon, 10 Apr 2023 18:04:28 -0700 Message-Id: <20230411010512.5375-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411010512.5375-1-richard.henderson@linaro.org> References: <20230411010512.5375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, SUSPICIOUS_RECIPS=2.51 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org Since TCG_TYPE_I32 values are kept sign-extended in registers, via ".w" instructions, we need not extend if the register matches. This is already relied upon by comparisons. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 989632e08a..b2146988be 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -458,7 +458,9 @@ static void tcg_out_ext32s(TCGContext *s, TCGReg ret, TCGReg arg) static void tcg_out_exts_i32_i64(TCGContext *s, TCGReg ret, TCGReg arg) { - tcg_out_ext32s(s, ret, arg); + if (ret != arg) { + tcg_out_ext32s(s, ret, arg); + } } static void tcg_out_clzctz(TCGContext *s, LoongArchInsn opc,