From nobody Sat Nov 15 05:21:32 2025 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1756074549; cv=none; d=zohomail.com; s=zohoarc; b=fWZEV2LqVMc+ptL1mBcItHSsHixXUYRUKB5rKKy3b2Hhlzb68QXXYnC6Vy0GUB7JOtFFYkSr0W6MMczmOpnEgiJWw0zMk2cNkMXl6jvQ7ioCr0Z+w9ZqHeGff3mPlII/LprzMozrXZWZyY1EoQtet6NHta+ptuJrGEoXi1y5Lcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756074549; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sW4KE+q/biI/RulLgySIkhUyzp2bDHwahwhJi5mZvSs=; b=guIkctgEKjVZRQMjqGiRmVU1ewnjmtbvQF76W+j0bjFobTeyNdhPgVKqyavrLjsflcbIQFhbYI+5JR/meGklPDitJKXFzRDrC7QJ0p+9w5D4t4kUOTMOV8O29T5JvEEpP2+fSa7Uyy74fh3dyzEd/v6VVstdDUFkGQ9VGThxJh0= 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 175607454966727.7065761087664; Sun, 24 Aug 2025 15:29:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uqJBs-000631-De; Sun, 24 Aug 2025 18:27:56 -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 1uqJBn-00062K-FI for qemu-devel@nongnu.org; Sun, 24 Aug 2025 18:27:51 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uqJBl-0006A4-As for qemu-devel@nongnu.org; Sun, 24 Aug 2025 18:27:51 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-33663b68b06so6485941fa.1 for ; Sun, 24 Aug 2025 15:27:48 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3365e5a5b84sm13300821fa.36.2025.08.24.15.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Aug 2025 15:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756074466; x=1756679266; darn=nongnu.org; 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=sW4KE+q/biI/RulLgySIkhUyzp2bDHwahwhJi5mZvSs=; b=mWLD4h51/g/PDlsnkj3MLBDZSPsCOj1BG+LXOSpcMSRpMSLn6Y+9YGLleGtoCo0pJ1 aS4zYmkKaxmwdTtpO4TvkRE9EbsIbTGY40K0Q5OQnzy5GBRGXBDKR+sPMv8QLzM1YZvX LZzS0PV2cUEglkKCx9mS0jnGvBp2QvQbQZ0gYgbZ/zeDO79tPWh9DCPJQd1AnuQSQJ4A KintEr7tbI4eVY5UxfK+rQEjJLo5auua4Yndjq6VOSV0T0jiQjKD1sK5StkUQRtmWEKy 4utUCEY/0eMgeMavGxicRD5CTOxHVFQcKPriafIH4H3MoeEkKOCM6+X46tZoj7KBaPJB 6Spg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756074466; x=1756679266; 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=sW4KE+q/biI/RulLgySIkhUyzp2bDHwahwhJi5mZvSs=; b=lDsD/ssNqKS2Z18msQPRxg0Qxdza5V1TX1gBxwHRt62MjzhSRb03uIbsdo0lrSX4O3 Oo4bEMs4n5N8pMZ6nvyczSdIG+Dcvg4W7Cnc8jGbSpHCOlXbCGuxhGezM3JLcZ3gLC/+ TayVkVuISKu6f1HrUpGr1R3pxJ6wXsrRbyd6nOfhnJIDXB3Wyva5f/uBN/3BfGlXWXSA Ba6WCqIcFLT273EMybR9rrxeKmmhAxctjfj0cT039fy8neNYZNpxPE0zit2MgSm8OIy0 RxHUlCTeYOxDeZJeAh6egKly7qwnBjqUTsu4fj3BZ1WBdkFmWltnzZ211Dl54aLqh9KI kxAw== X-Gm-Message-State: AOJu0Yz2g+VNnR1bCFnui2u2DFBaRYPBP3chMyYdGHtEAJD9XNYvMkfC OmFWTEcj49XucQOqACgyOML6QaDHj7UdzFoFDAo3fQLElof1634pnWy6NYciiY6N X-Gm-Gg: ASbGncvMzrQDcDok18fiwMBwCzbp8zjmaxLLYzhJF1TIaPP2gEXSMaPN9KGlmWRYSqn DScoBuppdtCYx6jOKpItZ4ux2V+V84US9BNA8kLRz7AkwYQhV711BOin7fNlWnHLhyDDae5mbob pQh8OvEYiJFmcq/3gAFUKpNJ84UN18L+ojxxpdi6L3JkvImXly6lGIHjX9WsrjIHuAZwxUMzljj hxUwcLJ9wrBP8YjlBaJIxgy11D0kZUxzmhvUdz3waG21b8T+OP/Z5emtJ2bNbcBxu/NMCNUeuQK 5p2XBs2FW+91/v6B9p8A6uHaEbS4EUiIV5yNXX/xVsOOiNxvZgAdvNKLD6huDKGQAsBDYcXCsn9 jhyFXGV8X7qgW4cVKktz6fiAFNFM1rO2KfvjqafUCM0UvjxqxY8/yZ0lqfIoh3D8onkzXHg== X-Google-Smtp-Source: AGHT+IH+gFc0twzGOAt6AiD5yYfRo1QdsB/dB9UpE6Nm7MIS7bxy9hfG+o+lszs0ol5XReAPbJ47MQ== X-Received: by 2002:a2e:a008:0:b0:32b:9220:8020 with SMTP id 38308e7fff4ca-33650f5098cmr15427721fa.34.1756074465609; Sun, 24 Aug 2025 15:27:45 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, "Edgar E. Iglesias" Cc: richard.henderson@linaro.org, edgar.iglesias@amd.com Subject: [PATCH v1 2/4] target/microblaze: div: Rename and reorder function args Date: Mon, 25 Aug 2025 00:27:32 +0200 Message-ID: <20250824222734.4151956-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250824222734.4151956-1-edgar.iglesias@gmail.com> References: <20250824222734.4151956-1-edgar.iglesias@gmail.com> 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=2a00:1450:4864:20::231; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, 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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1756074552575124100 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Rename and reorder function args to better match with spec and pseudo code. No functional change. Signed-off-by: Edgar E. Iglesias --- target/microblaze/op_helper.c | 18 +++++++++--------- target/microblaze/translate.c | 12 ++---------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c index 470526ee92..092977b3e1 100644 --- a/target/microblaze/op_helper.c +++ b/target/microblaze/op_helper.c @@ -69,9 +69,9 @@ void helper_raise_exception(CPUMBState *env, uint32_t ind= ex) cpu_loop_exit(cs); } =20 -static bool check_divz(CPUMBState *env, uint32_t b, uintptr_t ra) +static bool check_divz(CPUMBState *env, uint32_t divisor, uintptr_t pc) { - if (unlikely(b =3D=3D 0)) { + if (unlikely(divisor =3D=3D 0)) { env->msr |=3D MSR_DZ; =20 if ((env->msr & MSR_EE) && @@ -80,27 +80,27 @@ static bool check_divz(CPUMBState *env, uint32_t b, uin= tptr_t ra) =20 env->esr =3D ESR_EC_DIVZERO; cs->exception_index =3D EXCP_HW_EXCP; - cpu_loop_exit_restore(cs, ra); + cpu_loop_exit_restore(cs, pc); } return false; } return true; } =20 -uint32_t helper_divs(CPUMBState *env, uint32_t a, uint32_t b) +uint32_t helper_divs(CPUMBState *env, uint32_t ra, uint32_t rb) { - if (!check_divz(env, b, GETPC())) { + if (!check_divz(env, ra, GETPC())) { return 0; } - return (int32_t)a / (int32_t)b; + return (int32_t)rb / (int32_t)ra; } =20 -uint32_t helper_divu(CPUMBState *env, uint32_t a, uint32_t b) +uint32_t helper_divu(CPUMBState *env, uint32_t ra, uint32_t rb) { - if (!check_divz(env, b, GETPC())) { + if (!check_divz(env, ra, GETPC())) { return 0; } - return a / b; + return rb / ra; } =20 /* raise FPU exception. */ diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 5098a1db4d..2f5fd5c271 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -450,16 +450,8 @@ DO_TYPEA0_CFG(flt, use_fpu >=3D 2, true, gen_flt) DO_TYPEA0_CFG(fint, use_fpu >=3D 2, true, gen_fint) DO_TYPEA0_CFG(fsqrt, use_fpu >=3D 2, true, gen_fsqrt) =20 -/* Does not use ENV_WRAPPER3, because arguments are swapped as well. */ -static void gen_idiv(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) -{ - gen_helper_divs(out, tcg_env, inb, ina); -} - -static void gen_idivu(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) -{ - gen_helper_divu(out, tcg_env, inb, ina); -} +ENV_WRAPPER3(gen_idiv, gen_helper_divs) +ENV_WRAPPER3(gen_idivu, gen_helper_divu) =20 DO_TYPEA_CFG(idiv, use_div, true, gen_idiv) DO_TYPEA_CFG(idivu, use_div, true, gen_idivu) --=20 2.43.0