From nobody Tue Feb 10 23:54:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629320126; cv=none; d=zohomail.com; s=zohoarc; b=BwPOWDyMZVkpY3M/YX6hQjHyJIT6n52dIFsotzp+ZlMtYUwC5Th9EVoPXcbrsFxDK5ft8gUV6TZyEGtFN+fSB5F8PxmSH4G0ch7WrqlK3oVZ/RwWHpZT7U3ApNS87FUhtJzLxeWnQ7MllxtBbhYRzof1J3XrPr+ue/8Njvt0N7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629320126; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yq7odZJKEOQT4jSEqTj2CmwhltJ5iDYOv4u5oxAiYrc=; b=C5OqNS2vQ7pJN4fgrYKs4Cq9eFOIo9aMaPWhzrhvoWh9GeqMB5lqGhT+SizJpQY/RyznWFV7NsqErftefW7Fypuh04JxyNNVO+OH3GLqGcRCaPQTi58fmg4gdkOBXwB3kJkdnGmSFYGxCayoxhxyU+xgyl6P5E9y3j2z28Qssg4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629320126270748.536990841129; Wed, 18 Aug 2021 13:55:26 -0700 (PDT) Received: from localhost ([::1]:43046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGSaq-0001ok-Nj for importer@patchew.org; Wed, 18 Aug 2021 16:55:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGSRv-0000KR-TC for qemu-devel@nongnu.org; Wed, 18 Aug 2021 16:46:12 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:36706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGSRt-00086X-GI for qemu-devel@nongnu.org; Wed, 18 Aug 2021 16:46:11 -0400 Received: by mail-pf1-x42f.google.com with SMTP id m26so3404835pff.3 for ; Wed, 18 Aug 2021 13:46:09 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id 143sm739815pfz.13.2021.08.18.13.46.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 13:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yq7odZJKEOQT4jSEqTj2CmwhltJ5iDYOv4u5oxAiYrc=; b=FgVfzNUZV2QQpxjHJooX4JVs5FVLMLc02p3fz+0j0m6KCpmKBamzTSwyXQ9L+1b2eS i+7Q5Nj38ICHQgxjY4Trf9ZGSHd6BRWG+q3emzaOjb1RYfK5k5e0rIfqxvn95lpP7UYp 3fVaJU/0IpqsrUNnGmgtI2omdiph5t/kDWNCeboXv95BxKdYFzwJNUuKvcuTIINUdq2o 23B6hr0GvG+3nyf5hFqhkgUEEWLGlYclTi4iwp8chfeawIOd1CTdDCxYhCk69X4acJbv Q4cFNqT+xhVQ6RGQ3cT9TWrc+aoqWNBinSzbvrDOZMLe1UVc9zuNuqwwSZ2VvbRjylAa BBPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yq7odZJKEOQT4jSEqTj2CmwhltJ5iDYOv4u5oxAiYrc=; b=VFqU8LsrprB/WzJp23RNfsktIWpGQZ/CATPz1zy8W2uyTCfAhKNSMoJNAuOzGDbJsw TU/hwEDIGy7G/Tgi9ytiyfiWhIQ9DxwunTnLBy5+QpIk8QjmL1v+KCgFiESdaATWJceH vE//rRvZ0JSxKIEJq6TFvfUhI6o5F7TjoDYPHu0rYYhUPe3NSrDYnYdJPz7IrBMYZdMU PnpAFgzAPlCnp8K4FEpp+jvuqZ2bcfdX6cNkjQrz3NC+Hr5l86z3JwxbjC6a+EKfOitK O2Lb0WjPo5SCwpOT1HekD266hj3YOgD1WJnLno0iClFlTVCf2mxIffkFs0UbRzuuNj4K piSg== X-Gm-Message-State: AOAM530lwJMkxTvTVO2MzqZrwoMvtwjimaF17MvJuvArSh8fUhMd3uCg Ry94AhHU73Di37Xb7cIZkFGx+AJXLYIu+g== X-Google-Smtp-Source: ABdhPJwXL9t468+b/0UmtJJt0w3yz9dDxuElNY1HvR92VOrWXHSutTMIIhE0wHR903WcOVHjCQfvbw== X-Received: by 2002:a63:5c1b:: with SMTP id q27mr10550475pgb.284.1629319568262; Wed, 18 Aug 2021 13:46:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 3/7] tcg/sparc: Add scratch argument to tcg_out_movi_int Date: Wed, 18 Aug 2021 10:45:58 -1000 Message-Id: <20210818204602.394771-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818204602.394771-1-richard.henderson@linaro.org> References: <20210818204602.394771-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) 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 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629320128062100001 Content-Type: text/plain; charset="utf-8" This will allow us to control exactly what scratch register is used for loading the constant. Also, fix a theoretical problem in recursing through tcg_out_movi, which may provide a different value for in_prologue. Signed-off-by: Richard Henderson --- tcg/sparc/tcg-target.c.inc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tcg/sparc/tcg-target.c.inc b/tcg/sparc/tcg-target.c.inc index 9dd32ef95e..f11f054df5 100644 --- a/tcg/sparc/tcg-target.c.inc +++ b/tcg/sparc/tcg-target.c.inc @@ -414,7 +414,8 @@ static void tcg_out_movi_imm13(TCGContext *s, TCGReg re= t, int32_t arg) } =20 static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, - tcg_target_long arg, bool in_prologue) + tcg_target_long arg, bool in_prologue, + TCGReg scratch) { tcg_target_long hi, lo =3D (int32_t)arg; tcg_target_long test, lsb; @@ -471,22 +472,24 @@ static void tcg_out_movi_int(TCGContext *s, TCGType t= ype, TCGReg ret, /* A 64-bit constant decomposed into 2 32-bit pieces. */ if (check_fit_i32(lo, 13)) { hi =3D (arg - lo) >> 32; - tcg_out_movi(s, TCG_TYPE_I32, ret, hi); + tcg_out_movi_int(s, TCG_TYPE_I32, ret, hi, in_prologue, scratch); tcg_out_arithi(s, ret, ret, 32, SHIFT_SLLX); tcg_out_arithi(s, ret, ret, lo, ARITH_ADD); } else { + tcg_debug_assert(scratch !=3D TCG_REG_G0); hi =3D arg >> 32; - tcg_out_movi(s, TCG_TYPE_I32, ret, hi); - tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_T2, lo); + tcg_out_movi_int(s, TCG_TYPE_I32, ret, hi, in_prologue, scratch); + tcg_out_movi_int(s, TCG_TYPE_I32, scratch, lo, in_prologue, TCG_RE= G_G0); tcg_out_arithi(s, ret, ret, 32, SHIFT_SLLX); - tcg_out_arith(s, ret, ret, TCG_REG_T2, ARITH_OR); + tcg_out_arith(s, ret, ret, scratch, ARITH_OR); } } =20 static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long arg) { - tcg_out_movi_int(s, type, ret, arg, false); + tcg_debug_assert(ret !=3D TCG_REG_T2); + tcg_out_movi_int(s, type, ret, arg, false, TCG_REG_T2); } =20 static void tcg_out_ldst_rr(TCGContext *s, TCGReg data, TCGReg a1, @@ -837,7 +840,7 @@ static void tcg_out_call_nodelay(TCGContext *s, const t= cg_insn_unit *dest, } else { uintptr_t desti =3D (uintptr_t)dest; tcg_out_movi_int(s, TCG_TYPE_PTR, TCG_REG_T1, - desti & ~0xfff, in_prologue); + desti & ~0xfff, in_prologue, TCG_REG_O7); tcg_out_arithi(s, TCG_REG_O7, TCG_REG_T1, desti & 0xfff, JMPL); } } @@ -1013,7 +1016,8 @@ static void tcg_target_qemu_prologue(TCGContext *s) =20 #ifndef CONFIG_SOFTMMU if (guest_base !=3D 0) { - tcg_out_movi_int(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, guest_base, = true); + tcg_out_movi_int(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, guest_base, + true, TCG_REG_T1); tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); } #endif --=20 2.25.1