From nobody Sat Sep 26 19:16:26 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=1790261469; cv=none; d=zohomail.com; s=zohoarc; b=Qaz+vabXuuBTBrSYrBdseAxwx8hWJftsTGk5rpTM8Xt/ddYJlKz4yyDJ+zWZxSa1XtVUeE3AUT8491/Wy3L8xXyNRJXuXqO0Z/0eX/2jpT+KRe9pCegfQBy61N+OtFRZqcXWRtB5A2DbVafW1uGPHa19CuVnfn1C+hxgofZQTBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261469; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xjovDEJSNYjANL2FYe2ilo3Bs/RcIdWuQfxv9h97UtE=; b=dGddCBuIABHhKQlFJ5nSKtqHKycKunQgXCpiqNsTBePHoEM5x4cBY9CJR3U1XqIOuutb7bh4JcpGL6LQ2eQE790PQvdUSfqJn2oQoLAgDosuIJOlUP+BfIzIjSZAEzKj+ZFOVH6k0jep0R+EwMHqWh/SfSoKQyyZDt+Ylnw8uEg= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179026146961134.7534525610464; Thu, 24 Sep 2026 07:51:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9klv-0008Ul-C5; Thu, 24 Sep 2026 10:50:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9klY-0008KO-CE for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:43 -0400 Received: from mail-pz2-x0f.google.com ([2607:f8b0:4864:3b::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klU-0005EE-J0 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:39 -0400 Received: by mail-pz2-x0f.google.com with SMTP id d2e1a72fcca58-8631d0023daso1172416b3a.2 for ; Thu, 24 Sep 2026 07:49:35 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261374; x=1790866174; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=xjovDEJSNYjANL2FYe2ilo3Bs/RcIdWuQfxv9h97UtE=; b=QpY9TWNeFrQwuLszW4A0TIjQ+tJlMRTHSNQ9V2PUSLitz3C5o4oxhd96cPz+5sHCou V5LR+XQQK8vAazk34Ka1XF1Mo4i1FK0LTnWnPHWnDjjQTjdtNaVEuaVBGty/gZiUaud2 hCXeodm6sG4YYtSKaDKP2GQuNcXsBG3k/qz1F7tsDPvmLmbB0m56vRC7mi1AqdasWSKr Nr+TwxjKK12w26nuXHaeWapwzbNOtvzF9nNFWdxLlCoViXgeJwtvNPJO5jQCOd0/Kkoa Ca0A+UdzzbDlTDKMuYJeDLOPSlZH9kSwUXkEuux1NaXyYS4/JkrlE6ovTxRB34jfh5DP wbFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261374; x=1790866174; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=xjovDEJSNYjANL2FYe2ilo3Bs/RcIdWuQfxv9h97UtE=; b=cx0T4Bksa8Jg6OL23cVATkmvL81ZQLfZW52G6LHDYNBtAoptDZUUEUWdt+uuJFZXed fHr7hkor+JNNxhPaLd6aRAzw4t/uscGALM57e8EgHADvYkTLR6CBkTUbWILVuWTQEZnR XnE/qgWRY0OChxo6BxW0XweCKkR6FJxEv2zhcPxSVzaEv7UEJtEww4Ck34agpX3y80MP RuTRzeagdo8raJanXH0aUP14h0233pW3Cjyiplod1MHHyohwn2EaBLGvRCuK+0+D6IsJ +pJVSNKRA64IRIX5gqyNgkPOqvTW1NaI8Yf0WX50HHKIl3hBhcI+Ap1ICa2VWKajBfPL lRtQ== X-Gm-Message-State: AFuF++nCk9CIZAvK1XX3IFvkZ0DeYDO2ByR9slcXWszzdFc6o1JBOMVm 8lKYSeOY+/jYbZtECPGIkEtkmdiJbfKHCqub/4++svXCC6AW6rwlQCULdQ9bt7vXNWPB6zMi0Ur KP0Lt X-Gm-Gg: AYBFou1nqpQVkQFRxfJN4adLKR+IKWv0S+LiabK6CuZKuBB5c6+DlfjcV2wU8+hYiqL KmfeLL72dhNkHoDabiE38vshqIsuNF5RC/7IkPt+S3ReeSnCgSI/yh9/WZr3CBk7o9aC/TeT5Yp NqyWcU6ECNy7hm4Wj235MA2U86PGkXKa82vH2dHXY97UKlsk4Rpr2cmHJhhJoNRhGqCpxPmXyZm kY7WMKJuh6GzzoMVQNAc5DfdpMGxv+8QIjs7MXP5Ci2qsn4RXU6lDpx7pS+lIiQJMydscDHnLMh lW3Sn9+P5cE1ArD0pIKedYdhBSaSroabnvmPJNMYNXMUV7sp/ohIut0tilnDShlaMHPCxNCKVgj crQHG2RKwQEAOROY5/gRsPsQNjLh9z9Y+z6eenfkUE8FXalYzpn3aFok0m5r1vJqZxok1tZK0kN adyc4QRelCfy8ryAhNTuQ3vf76fnFrPpLSvkAgJjUHnT1Lf1+e5mZahC8IpOLN6X6lrrzkHPu2h N1JwLUMH8wNZ9sWoVG4wO3i+yS6U4EgDTLUkCnQ X-Received: by 2002:a05:6a00:4650:b0:87c:e44e:5694 with SMTP id d2e1a72fcca58-87e98f91b9amr2173927b3a.21.1790261373983; Thu, 24 Sep 2026 07:49:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 1/8] target/i386/tcg: Always initialize CCPrepare.reg Date: Thu, 24 Sep 2026 07:49:24 -0700 Message-ID: <20260924144931.161335-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::f; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x0f.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, WEIRD_PORT=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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261472056158500 Forthcoming tcg improvements will diagnose the passed null pointer with --enable-ubsan: ../src/target/i386/tcg/translate.c:1177:5: runtime error: null pointer pass= ed as argument 3, which is declared to never be null #0 ... in gen_setcc ../src/target/i386/tcg/translate.c:1177 #1 ... in gen_compute_eflags_c ../src/target/i386/tcg/translate.c:1182 #2 ... in prepare_update_cc_incdec ../src/target/i386/tcg/emit.c.inc:407 #3 ... in gen_INC ../src/target/i386/tcg/emit.c.inc:2213 #4 ... in disas_insn ../src/target/i386/tcg/decode-new.c.inc:3151 #5 ... in i386_tr_translate_insn ../src/target/i386/tcg/translate.c:3514 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index d8de290acb6..192cf43215e 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -891,7 +891,7 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, = TCGv reg) =20 case CC_OP_LOGICB ... CC_OP_LOGICQ: case CC_OP_POPCNT: - return (CCPrepare) { .cond =3D TCG_COND_NEVER }; + return (CCPrepare) { .cond =3D TCG_COND_NEVER, .reg =3D cpu_cc_dst= }; =20 case CC_OP_INCB ... CC_OP_INCQ: case CC_OP_DECB ... CC_OP_DECQ: @@ -965,7 +965,7 @@ static CCPrepare gen_prepare_eflags_s(DisasContext *s, = TCGv reg) return (CCPrepare) { .cond =3D TCG_COND_TSTNE, .reg =3D cpu_cc_src, .imm =3D CC_S }; case CC_OP_POPCNT: - return (CCPrepare) { .cond =3D TCG_COND_NEVER }; + return (CCPrepare) { .cond =3D TCG_COND_NEVER, .reg =3D cpu_cc_dst= }; default: return gen_prepare_sign_nz(cpu_cc_dst, cc_op_size(s->cc_op)); } @@ -982,7 +982,7 @@ static CCPrepare gen_prepare_eflags_o(DisasContext *s, = TCGv reg) case CC_OP_SBB_SELF: case CC_OP_LOGICB ... CC_OP_LOGICQ: case CC_OP_POPCNT: - return (CCPrepare) { .cond =3D TCG_COND_NEVER }; + return (CCPrepare) { .cond =3D TCG_COND_NEVER, .reg =3D cpu_cc_dst= }; case CC_OP_MULB ... CC_OP_MULQ: return (CCPrepare) { .cond =3D TCG_COND_NE, .reg =3D cpu_cc_src }; default: --=20 2.53.0 From nobody Sat Sep 26 19:16:26 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=1790261464; cv=none; d=zohomail.com; s=zohoarc; b=ai6YUzdTU9zmXsD8cCg9Twc8thL8QPGE6Y6SoDzb+xyNS73V5c0QOsYc6oddRvCx1jB5udAKaQee69mxlMchYWytsOjJp+1eQnZhxoLJECRMs35xcmWAiwJl/bgbiit26+qz46xa6uzALuXlZ8cnzTjyrSvOIVcQb6/oQs9dlV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261464; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SUHli38uwCMd7XorFSNsBkETvs+zfkoOrDzDPTZtZxU=; b=G+KOCf6Uv3PzU3c9O6YyVbygrpGwwltEvip4dHDKo2TkZ3t61idcCpuxJvyWvykkqfu6nqOBDz5AVqDcvruy0P1Fj3L6oCMZDkEFykFxJ8EsUYySLCFjcLCuxPUxQrWxjHIXnCthIxbhPl11FEEO2yGAiwWMoBm7CJ/Ba91XpXs= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790261464416759.0063611744193; Thu, 24 Sep 2026 07:51:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9klo-0008QB-49; Thu, 24 Sep 2026 10:49:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9klZ-0008Kv-MH for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:46 -0400 Received: from mail-pz2-x0d.google.com ([2607:f8b0:4864:3b::d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klW-0005EJ-4o for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:41 -0400 Received: by mail-pz2-x0d.google.com with SMTP id d2e1a72fcca58-85469a34908so1527384b3a.0 for ; Thu, 24 Sep 2026 07:49:36 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261375; x=1790866175; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=SUHli38uwCMd7XorFSNsBkETvs+zfkoOrDzDPTZtZxU=; b=pdPheIKfiL1bvi6o1GuSV6aMFhBsMo7dn2KPQVx2Rx1lnFbVlRzgGxNm8xN++KfuX1 rSbUDoHocOdEsyEE3BcQaIeRR6O8Kb0VSlVHb1nGdhKtrcA3GGhvbc42uOFHfcg9KpgG CUAA8RnFECfmC28bEGj3LjM4sFdykR1ulqves9JHv3ajlxh187SeJ6LZYibG+X+Xiw89 kJEQBotzgBBwAU1CD4xxxUOF6lgL34sv6GdGlvYWG2TZbuxsPLAL7Lu04Rp5bd4Fnp8L 2ZpaL0gWe4i5IsrJ9VhAWvo7ZMpHtqdwSERvlAebspmHDpSlbBRvHqZOWtAmDPd/4xJo HTow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261375; x=1790866175; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=SUHli38uwCMd7XorFSNsBkETvs+zfkoOrDzDPTZtZxU=; b=qLlVqusoMk3jafdB7W7l5xIQTdjL2FhMAW2R7U8PC2kILeFl6d+fTb0mwlLgQgzclY RZtPcVk/1OlOctdKefV8sjdzb/V6FjMtWRgQNYqLIBedcjhWdHMBjtoAnzhwB24DGlpG pMTo0WJbtxNZHEVcKImT8XgYyZvi6ZfUCIxf4vdUXAEZD/NwypW2SgP3jWX03WJfu8lw EdB4wSaH3ihrb7MeAPkm93qU3BGs08KFU6hIUKmp2eZw34NuDPXWcNG+ZGxBPA4N+RDo RBRqpADCxU0jLrN3rwRM1dIm2XvDIeUefXJVAKbVf7mK1BrPXxDvCk2OESJGJfX91ddJ 3ksA== X-Gm-Message-State: AFuF++lA5i4mpQLeulm+h7VGIOZqnLCeP/xamB4FEYhAnXlsOY4KKG0f AGf242xNo0k3LBTh4KcERFFvbjoqOMHAMqipi8Qqsa+igt5ItpffwQZ9TDzmum8efsCw+cCCdVT myk9o X-Gm-Gg: AYBFou3fU//mB0dlOrdTBXonJ1dg8jc3R0NSR6Hhn0IRWvo9KBxhfddJ1Zd3bKgghEm 6kvd2MSf/JYbgWmPsgK1LS13M/LNNELOMCydj81vENkgStOWPKe4nJHly1tFDsMhdMVGml8R6CM 6g7MnzLMxrlXJU5Irar7tJXbFOc+ouMZX7XoA9aKIdyZFYrTR6AGP88S0tXVocJ1qei1T8REA5W vvQ4J/5DTKLy7aP82/7NYMgkjng5AZFQ2SMZJ4FoXKXKiwaT2aKaixOvc34vAztkVTPObXMYgCf 7fe+odSzr+3IZuR3yNJEp8qh8e7Lx6N7zBTqRbKnIHr7NGjRSg+bOZbo6GRW8O5/7JySKaw8bYS JiLRvX3ENN0age1vHJsvwxrooV1+VPRWAnYGxj96BhTKYirJkbfRj+YBOczbrpUlKHzbMUnhUDu 42P7KpD6IgCFS/G57WBmEzM6FPRLQxsViAWpQfBOw5+d3zKZDMXScuif74/hPeX2vjV/50umhhr JyWHmK0koM+9xLJ+60lsodMbFtW6QUM9PuCuZ42 X-Received: by 2002:a05:6a00:2d81:b0:87d:3894:196a with SMTP id d2e1a72fcca58-87ea1483aabmr2439254b3a.57.1790261374685; Thu, 24 Sep 2026 07:49:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 2/8] target/mips/tcg: Fix zero in gen_mxu_d8sum Date: Thu, 24 Sep 2026 07:49:25 -0700 Message-ID: <20260924144931.161335-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::d; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x0d.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261465899158500 This is obviously an attempt to set temps to 0, but accidentally passed NULL to a regular move. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 7961b073144..9559b8aada3 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -3109,7 +3109,7 @@ static void gen_mxu_d8sum(DisasContext *ctx, bool sum= c) tcg_gen_add_i32(t4, t4, t2); tcg_gen_add_i32(t4, t4, t3); } else { - tcg_gen_mov_i32(t4, 0); + tcg_gen_movi_i32(t4, 0); } if (XRc !=3D 0) { tcg_gen_extract_i32(t0, mxu_gpr[XRc - 1], 0, 8); @@ -3120,7 +3120,7 @@ static void gen_mxu_d8sum(DisasContext *ctx, bool sum= c) tcg_gen_add_i32(t5, t5, t2); tcg_gen_add_i32(t5, t5, t3); } else { - tcg_gen_mov_i32(t5, 0); + tcg_gen_movi_i32(t5, 0); } =20 if (sumc) { --=20 2.53.0 From nobody Sat Sep 26 19:16:26 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=1790261486; cv=none; d=zohomail.com; s=zohoarc; b=c88PaLV0QxyxLyufF646sZKwKZ7lgmyHLbefxHWB9FUJYGwY52dLaANmgmOiHyUxbc2yQDvOJv6x7Wi6wTxYYV0D0iQVAj9AgNkYjnln2FlZoA3MG90TPAd9VjbI4pCMNQZ5Uhnmp3LhV3dw/7uuq5fIkr8pY0lN8wcGiPiDEEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261486; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DvW4sTNElEx9UXHErcO6hMyThrj/L63pKktyde7yDpQ=; b=lnUxRS+0l6yzPZLjqlcSrnA6ZFar9fD5QH3okqrRwM2lnxBx9K6Jo3apCAvWZcrDkEjYQbuW3i9JL+/ytzf+9r9tt+hm6A5JgLokSNBmwIFP7VZSeIT0HEpiavbSE+8wcbFZo41fNmBZcwTMVDthSNvZXpM+5+uBIVOdXXfNOPs= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790261486321275.0598164709561; Thu, 24 Sep 2026 07:51:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9klv-0008Um-LX; Thu, 24 Sep 2026 10:50:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9klZ-0008Kw-Mc for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:46 -0400 Received: from mail-pz2-x0d.google.com ([2607:f8b0:4864:3b::d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klW-0005ES-55 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:41 -0400 Received: by mail-pz2-x0d.google.com with SMTP id d2e1a72fcca58-868cfc5c244so765183b3a.3 for ; Thu, 24 Sep 2026 07:49:36 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261376; x=1790866176; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=DvW4sTNElEx9UXHErcO6hMyThrj/L63pKktyde7yDpQ=; b=MG5nXB17jTQlBkNnpy9px+Qs6XT+U3nJRVIvRFyUW5GHF3+iCImd/pvmFs03I0oOFh dvu+GZgyl2TW7FIeXQI5PRCadX3vkE3M1pxTGF1/hpN9su7tPVqfM58L/o9nNIWJfx/4 pNIet+NuoCpV1MVSEEfpKLQFnZW3eepLVWY30p51kLUwFCeIHZ3mD0iPA3DOu7nSn92X G8bUHAoqQpwrxePjI8DiqPSCQ40yuGBYRYfsomM33oKrE70Z3rS0f/KZOofMX50K1y+a P0GNE0gJEWBlg55UVAvpm2pFDGx4fXMZTF4SKQz5ErcFjxrTUXO8eoxqBIz/xu7BJSYa lGKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261376; x=1790866176; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DvW4sTNElEx9UXHErcO6hMyThrj/L63pKktyde7yDpQ=; b=RxdFiYNBJAJzry42nLF1z1DCk5xF0KkNFW8ZOg4ShkdjQpUfrUU8XzV/1T24Ml9mwq CINqCaaeAXnmogrsld6Uw5t+tR7kDrCPwSrzbpNsZz5ZT0Jp4NqgJ8KqjeK6fuNck7mc JaQC1DCcXxLCZjQCkYTzih9KryMa7yEGdJkp4Ou75qL4e6h+ufpOc+xAllpgdRSd2VK6 3Zn+p5HUoTXc9E+bw1xZ4WT2ZMblYY/h24PnegTqnvtuqlNMTBJEdzjhIanGOwOMGV06 3A7hMUlVEb1e2qKbNrPd/tA2VaH+l/onfy5XcBAHiHyNyDFHSbWhiabFZaegVpKDZ1v4 E96w== X-Gm-Message-State: AFuF++kcd1bsc+j4fh5zQL/2w6T3bMnektS9LbASgBXNx+wKhHochm4d kBtXBp9s5oiPJ/p6kQ1+5irErJfB+utDgLd+hqA3b/L9ukaHn/xjgGB0o8ENcstNrd5aNmHf1g2 PTOxI X-Gm-Gg: AYBFou2DjMX65N80AqiEQd+B066ktnzsF/wkSHutywf4Fy0d87GuaRAmmZqPpWqZNxq /O9rVbmD0PRKBKWOFJiRo2Kz2loWfVndULBGf5wdw+J+amj71nf1gEAqDAKX0C79IHoUUKJxgH7 qNTn5Be42b9XG0tFcT6L5Wt5LIrGNhpexu4Ul+aLhtMjLRqVfJQI0y8YJ/zrj/zdH5/32b154Wq gucOUe9GzPa7KnZTQTtT12j5hloQEf2sheJEdcrJM3TM3E/i87ZvMrLjLqo50x9zgYBlIwSiulG xcqLXwjh09A2/9VhYhzrBbEEuFkMFoKwwmNiyCLiv7fDDTadIc9VCojfmDkzA8d7P+byHwxRht8 50ObRg9uBr2hRcaPfvIrv+/m1DcNBUNEk7RRuP/0h6wrRxb9McjDqb7QA56JYh/WbFCeP6VEmAZ 3eC8aZCkzLYLwGjLkUV1+fpYHjdlXEgPWPNZ5El6JTOWY2F6jzypk/VJ9BiJBSgEnQHTpDPxA0l dTcPNhIUONsuZootyNN0tWriLM2trdFLF4eptKZ X-Received: by 2002:a05:6a00:35c9:b0:874:705d:f639 with SMTP id d2e1a72fcca58-87e99e41f56mr2246001b3a.27.1790261375751; Thu, 24 Sep 2026 07:49:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 3/8] target/mips/tcg: Drop zero optimization in gen_mxu_s32mul Date: Thu, 24 Sep 2026 07:49:26 -0700 Message-ID: <20260924144931.161335-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::d; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x0d.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261488074158500 In the unlikely event of the architecturally valid case of using the zero register as a multiply input, this will be folded away during optimize. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 9559b8aada3..f30883f976f 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -964,18 +964,13 @@ static void gen_mxu_s32mul(DisasContext *ctx, bool mu= lu) rs =3D extract32(ctx->opcode, 16, 5); rt =3D extract32(ctx->opcode, 21, 5); =20 - if (unlikely(rs =3D=3D 0 || rt =3D=3D 0)) { - tcg_gen_movi_i32(t0, 0); - tcg_gen_movi_i32(t1, 0); - } else { - gen_load_gpr(t0, rs); - gen_load_gpr(t1, rt); + gen_load_gpr(t0, rs); + gen_load_gpr(t1, rt); =20 - if (mulu) { - tcg_gen_mulu2_i32(t0, t1, t0, t1); - } else { - tcg_gen_muls2_i32(t0, t1, t0, t1); - } + if (mulu) { + tcg_gen_mulu2_i32(t0, t1, t0, t1); + } else { + tcg_gen_muls2_i32(t0, t1, t0, t1); } tcg_gen_mov_i32(cpu_HI[0], t1); tcg_gen_mov_i32(cpu_LO[0], t0); --=20 2.53.0 From nobody Sat Sep 26 19:16:26 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=1790261420; cv=none; d=zohomail.com; s=zohoarc; b=Pi1bqN6X1iofJMcjyylaNb+pkjMj2EywyjifXYpWF0+WY+4wAfkhvlGs+91D3x8zIzzFIBQMvtWmX66FBohjkYo+FrRWgHIegbvq09+QtBX4+2mCI5KwOduPEzu0B6biEvmng+OXmWqnYQzFUgVgxvhIgq9/sNevMXHvFOdsoTk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261420; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r+hPJBn6W1w3TeSRLCX8j8LMzNUFdeN/iLWVFxCqtMM=; b=PQfXcT24eFtbQR2AELcgkjp2fbzA1j25u/1Y8F4JZknPQ7xJkp4Kyz+dNLgdH4ZbQuBWPu5QOCd5zpy5kHs2Ilcz+FLMpQJP7/LKnj80q2h1F7HRM+Fe+94nL0TlK/h4D+DgQbY0hD7DRpfkNQgFPRVuvxBOTpLXxprmPzPsS64= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790261420139334.61795497597404; Thu, 24 Sep 2026 07:50:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9kli-0008O8-Lt; Thu, 24 Sep 2026 10:49:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9klb-0008LD-Fi for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:46 -0400 Received: from mail-pz2-x0d.google.com ([2607:f8b0:4864:3b::d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klW-0005EW-6w for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:43 -0400 Received: by mail-pz2-x0d.google.com with SMTP id d2e1a72fcca58-8692a856865so984814b3a.2 for ; Thu, 24 Sep 2026 07:49:37 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261377; x=1790866177; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=r+hPJBn6W1w3TeSRLCX8j8LMzNUFdeN/iLWVFxCqtMM=; b=qQnRnxOQndTdF/8tLykxsBuJT4ZrleI0fx+5oedYSSdnUFWx6mPc61F0Ds/iXdPOXM pZfAy+M8W8vbRLEbHRBISjZptl9iPC77onHFTHPeIPCsb5NFXctcT8MRsjVdG64+UKTh iVt2H91r4VUOAoHFgWXMuMXpOvJ3gKWYbCBDNKBuTC/Id1sMxo9nK6KFOQgQRgR9gx2q LPatLNXgHJwnbP1juXqjJnbGTeLwsQOUQo1Ah2otHD+qPMsANYbtfvyinwdNH6c/nivS wvJlA2tk99LuPUnV72sfUZjEUk/8dQNk3vk8ZK53OkI6zdv5lA488Rya4DoFXjfvNYLb aqCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261377; x=1790866177; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=r+hPJBn6W1w3TeSRLCX8j8LMzNUFdeN/iLWVFxCqtMM=; b=Lp6UncXowpx+zHGgbVBEGrWIx0d1eXII6HTYgZLv9ByxHm6IcqozVdqE6qe3jKWDkE pAnLWrbpcQjT7FB+Zxa5mkM72fbmaHlL3WCa8bBwwao3Z7R3BAUuMrtLoqnHj2hoW3NT JlX0YfYY0QjM2t7uG8zQO8Dhq6/0y7V5JK+TJgRZ13Fq73gqAQv1oQY+ExsDRvwx3vGx 0T9gTxCeJocFGRWhf94KM/HFy9tyBVkMgKIjaXlnTlPV3HqAk6dNj4cXYdanWMKsXR/+ 6+wvm/9VkiyyD0KtJ1/WQaf3xqiQ14oHftTaqEvEn8u8Qs0Pawhj67mHSwF3UjGGTTd4 0C1w== X-Gm-Message-State: AFuF++mG7aIo61VaXhupCZEOJOXPqD3kOsYbSlgftSjIyZ/RHhGz+Nqr 35/1gBGgzl73KFtzu86lkMhypc06vo7Dj5fW94p2G10s+jGYT1nAo68MdD/ERr3zlNIuzoHG8aT c3sOj X-Gm-Gg: AYBFou0HyFeIyJ8XJySp1ZMC4lKVYRx4PH3Ekin4t7tKmJ99bbYaU4c0IY7bUZh8F3T vnCujDxbsI4z5Ak08Bar51rdlww7waBcadOSD4GYHZIXriYBzgFv33XALweHnvP291W0vXytUfB cx4OLtw6U40Aa0xg3o76+cxzeVcLzVCDIHkJznHA12T3rHjnnqaId57Xu2FB3TSYhPZhtktQg1s 8SflbGscvvzC/rUiUqa7Dl0axIvkDr823JBKtf0Ff6/GNaVb+jmyz7kPdYHOuyLqch2tSADPmxL rM30wiKKeyIqNcI7WT6uWtTGO5/erWyqsIOR1L+8iV5ipqTLRTlqqUYrp5hU4zMcoSnpfGkJU+O LjFBAlLb3fWt4uEwPkkDs9jEHZgOg6FZXW2oFS4VXpe2U8e5cmgJJiAXZuCUO8fCE3krw892r+T Ff6zsXaIJ28HHKTWlwpE6MG/9Tfltpl7pZLHikgvKILPW9tMT30PN9Blw4xyGOlne4cnOgXhw7P qIG1fn7silRJMfOme7I7KT9j4b0jQ== X-Received: by 2002:a05:6a00:44cc:b0:87d:d6d1:c627 with SMTP id d2e1a72fcca58-87e9b3b6b2bmr2341046b3a.38.1790261376424; Thu, 24 Sep 2026 07:49:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 4/8] target/mips/tcg: Split out gen_mxu_logic Date: Thu, 24 Sep 2026 07:49:27 -0700 Message-ID: <20260924144931.161335-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::d; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x0d.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261422031158500 Split out a helper for common expansion of a 3-operand insns. Drop all the special cases for 0 and let the optimizer handle them. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 122 +++++++------------------------- 1 file changed, 24 insertions(+), 98 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index f30883f976f..3f8acfcdb8f 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -1685,14 +1685,11 @@ static void gen_mxu_s32stxvx(DisasContext *ctx, boo= l reversed, * S32NOR S32AND S32OR S32XOR */ =20 -/* - * S32NOR XRa, XRb, XRc - * Update XRa with the result of logical bitwise 'nor' operation - * applied to the content of XRb and XRc. - */ -static void gen_mxu_S32NOR(DisasContext *ctx) +static void gen_mxu_logic(DisasContext *ctx, + void (*gen)(TCGv_i32, TCGv_i32, TCGv_i32)) { uint32_t pad, XRc, XRb, XRa; + TCGv_i32 t0, t1; =20 pad =3D extract32(ctx->opcode, 21, 5); XRc =3D extract32(ctx->opcode, 14, 4); @@ -1701,24 +1698,25 @@ static void gen_mxu_S32NOR(DisasContext *ctx) =20 if (unlikely(pad !=3D 0)) { /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to all 1s = */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0xFFFFFFFF); - } else if (unlikely(XRb =3D=3D 0)) { - /* XRb zero register -> just set destination to the negation of XR= c */ - tcg_gen_not_i32(mxu_gpr[XRa - 1], mxu_gpr[XRc - 1]); - } else if (unlikely(XRc =3D=3D 0)) { - /* XRa zero register -> just set destination to the negation of XR= b */ - tcg_gen_not_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to the negation of X= Rb */ - tcg_gen_not_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - tcg_gen_nor_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - = 1]); + return; } + + t0 =3D tcg_temp_new_i32(); + t1 =3D tcg_temp_new_i32(); + gen_load_mxu_gpr(t0, XRb); + gen_load_mxu_gpr(t1, XRc); + gen(t0, t0, t1); + gen_store_mxu_gpr(t0, XRa); +} + +/* + * S32NOR XRa, XRb, XRc + * Update XRa with the result of logical bitwise 'nor' operation + * applied to the content of XRb and XRc. + */ +static void gen_mxu_S32NOR(DisasContext *ctx) +{ + gen_mxu_logic(ctx, tcg_gen_nor_i32); } =20 /* @@ -1728,27 +1726,7 @@ static void gen_mxu_S32NOR(DisasContext *ctx) */ static void gen_mxu_S32AND(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) || (XRc =3D=3D 0))) { - /* one of operands zero register -> just set destination to all 0s= */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to one of them */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - tcg_gen_and_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - = 1]); - } + gen_mxu_logic(ctx, tcg_gen_and_i32); } =20 /* @@ -1758,33 +1736,7 @@ static void gen_mxu_S32AND(DisasContext *ctx) */ static void gen_mxu_S32OR(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to all 0s = */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D 0)) { - /* XRb zero register -> just set destination to the content of XRc= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRc - 1]); - } else if (unlikely(XRc =3D=3D 0)) { - /* XRc zero register -> just set destination to the content of XRb= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to one of them */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - 1= ]); - } + gen_mxu_logic(ctx, tcg_gen_or_i32); } =20 /* @@ -1794,33 +1746,7 @@ static void gen_mxu_S32OR(DisasContext *ctx) */ static void gen_mxu_S32XOR(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to all 0s = */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D 0)) { - /* XRb zero register -> just set destination to the content of XRc= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRc - 1]); - } else if (unlikely(XRc =3D=3D 0)) { - /* XRc zero register -> just set destination to the content of XRb= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to all 0s */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else { - /* the most general case */ - tcg_gen_xor_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - = 1]); - } + gen_mxu_logic(ctx, tcg_gen_xor_i32); } =20 /* --=20 2.53.0 From nobody Sat Sep 26 19:16:26 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=1790261449; cv=none; d=zohomail.com; s=zohoarc; b=f1Mw+gi795panqkiFKm8CiNFyEruYKiff/wUYUa8ti9klB5fK7aF6iTNBPDR2bssi/HB/cA63Yj9dKL1aCRxvJbJ34dEc4jN7uVbWbFUMPzKo0pRkfBMxnyC3GhybWHnJIkJdDFHh7CinwSfrI5DGVFYuMoYhxv0cOq8jeSB+vU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261449; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n2lHJSnUMpeS2SqKMsjTYAycECHfu0GOUATJYr54vBo=; b=f8qyU6ixQ4iZUeWPYD0QkAcDH+7NIVWMcnnjQtSBpqi1y0qoaUCIbbUo038qUMiXNJfXU0PJWJ6koCXbZu8pggpitcqH40+LfzYmblGxn1fNA+phUxvPWHf3N+kql2+NssctG9cTts1XClRQYIgWhd/DoOwPg4/YqR0sjw+g2/8= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790261448763561.8043140497236; Thu, 24 Sep 2026 07:50:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9klp-0008Ss-TM; Thu, 24 Sep 2026 10:49:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9klb-0008Kz-6k for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:46 -0400 Received: from mail-pz2-x10.google.com ([2607:f8b0:4864:3b::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klY-0005Ea-3C for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:42 -0400 Received: by mail-pz2-x10.google.com with SMTP id d2e1a72fcca58-8692a8568e9so1037591b3a.3 for ; Thu, 24 Sep 2026 07:49:38 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261377; x=1790866177; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=n2lHJSnUMpeS2SqKMsjTYAycECHfu0GOUATJYr54vBo=; b=oSBdSDR5vzKINDQZVt2CmIW/ZTbU+eAFTqNp8Yct1sv6Ctup642+YOe19VGtXRHMzo Mi4gb+/ujI3WGDuKrrFwIjFDWLyFOrzuoGKcmAHlOH3csW3z/+Eg144UQvk4kErEbuyo jbu72Ad6XR3YTtpZ7lqY3xR2/JcJRgE4EPsB3LmsVfOd3b2gwRKoemZjJF2zTQxB4nkj F57IMPXzPWktY71HSSptZPb6M6GPmlNoUC27TEBJkkoSM5jK43gjtkUgZdFqC6kYp8EH KNMkpgFhXXV1AF11pA07dXrLIGEk2GoJRfqL1BuQXbbwxtaj3LNGv4kbjkMtVriUK6bs NgJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261377; x=1790866177; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=n2lHJSnUMpeS2SqKMsjTYAycECHfu0GOUATJYr54vBo=; b=w3tm9fikPv8hIfDZ5Yq6QLXLM77C+fOGmx4fLtWN7U4TclI82tAS538DyI3iU5Vgp3 4z0qaJdiGSrr1MkrPEqKvQLjV9y1daPm6ixg52m+Q9/XwrI/hP+M8jI14vFA9rfTYFZo e9TXfUDutuhkaN8SoLhCAwaJAdxu6cIIq/ZhsHbn1Bb2f3IK+3n4oMsYKOsXCff4zQJl KQDMpcmwBKYbqqKaEVEw6HyNyZslwpU7n6nU0xVbspjJbn02nw3EYY4W0w9xBPsR2Kdj DzyAuwF2HkC3VkiaPeXvjOdWBP9okZE9B4lxRZyyfutA4ZLbFxDEsYNCUD5jf5qm0xm3 K08w== X-Gm-Message-State: AFuF++mJFOAT2+KkQMYK60pe0m41MIKCPfqxfMy3/QEQnECCTlJh2iRO GTi39hbsPcLrkTfpgPh1I83ih4pdllf7HkrjKsO//EFyg0zF9l5gx4p+xSRdUMdE4poZDI94sHh Qvo+r X-Gm-Gg: AYBFou0qVbFxvjlViKXSr6CT6wqIhLNLHFnj4hE70p0CupZ8Nd6ezgTIy43ft0NXXAg AT6voPup3BAqfLok81BUjwGfR0O/t0a7WZmDpKs1MwjdJU1gak+UYjgwbvEytjSckqBg0tCpsru m/6LDxPcGOgR/nSfSWcaOWE4wwg6XV7hddVRElOyDMjTIaHProABQTaAD/I6TEtnSN6ZcFkbr+l u1ZvozRjtE9jFMMr3r56RF3McWOhQufFt46j09mZSPpxEHpir4H/ESlNaCqaGFx10g/tpe6w+4k UBOOQ2qJexS2/Pb3Vscf4K+W6Ab2knLnrVSGHmNhQ+EXvUoJIgcgaLwWxd2LF6rXWwXoopafwoH a/OttKbuFjvSQfVUx8vhJ8U7FEYHHthpJm0nLNvfD//az63/6dbCfkK0feN+tLZJrluXpJze+mH NELqwF2meWGxSlx5mL9OTPj3bzyMHRbrB3u1ThaelQfbL6vhkljyTiK2+GWg8i480DEbV13zvan IunBvIoBq2hbri50esmhMc6mxZ4gQ== X-Received: by 2002:a05:6a00:e0a:b0:87d:e0ce:7421 with SMTP id d2e1a72fcca58-87e9d4d9a24mr2393156b3a.19.1790261377130; Thu, 24 Sep 2026 07:49:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 5/8] target/mips/tcg: Use gen_mxu_logic for gen_mxu_S32MAX_S32MIN Date: Thu, 24 Sep 2026 07:49:28 -0700 Message-ID: <20260924144931.161335-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::10; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x10.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261450235158500 Split S32MAX, S32MIN to separate functions. Fixes a bug in that "0" was passed in one of the zero reg cases, aka NULL, instead of a proper zero constant. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 47 +++++++-------------------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 3f8acfcdb8f..4b2c264f031 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -2045,45 +2045,14 @@ static void gen_mxu_q16sxxv(DisasContext *ctx, bool= right, bool arithmetic) * Update XRa with the minimum of signed 32-bit integers contained * in XRb and XRc. */ -static void gen_mxu_S32MAX_S32MIN(DisasContext *ctx) +static void gen_mxu_S32MAX(DisasContext *ctx) { - uint32_t pad, opc, XRc, XRb, XRa; + gen_mxu_logic(ctx, tcg_gen_smax_i32); +} =20 - pad =3D extract32(ctx->opcode, 21, 5); - opc =3D extract32(ctx->opcode, 18, 3); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely((XRb =3D=3D 0) || (XRc =3D=3D 0))) { - /* exactly one operand is zero register - find which one is not...= */ - uint32_t XRx =3D XRb ? XRb : XRc; - /* ...and do max/min operation with one operand 0 */ - if (opc =3D=3D OPC_MXU_S32MAX) { - tcg_gen_smax_i32(mxu_gpr[XRa - 1], mxu_gpr[XRx - 1], 0); - } else { - tcg_gen_smin_i32(mxu_gpr[XRa - 1], mxu_gpr[XRx - 1], 0); - } - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to one of them */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - if (opc =3D=3D OPC_MXU_S32MAX) { - tcg_gen_smax_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], - mxu_gpr[XRc - 1]); - } else { - tcg_gen_smin_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], - mxu_gpr[XRc - 1]); - } - } +static void gen_mxu_S32MIN(DisasContext *ctx) +{ + gen_mxu_logic(ctx, tcg_gen_smin_i32); } =20 /* @@ -4328,8 +4297,10 @@ static void decode_opc_mxu__pool00(DisasContext *ctx) =20 switch (opcode) { case OPC_MXU_S32MAX: + gen_mxu_S32MAX(ctx); + break; case OPC_MXU_S32MIN: - gen_mxu_S32MAX_S32MIN(ctx); + gen_mxu_S32MIN(ctx); break; case OPC_MXU_D16MAX: case OPC_MXU_D16MIN: --=20 2.53.0 From nobody Sat Sep 26 19:16:26 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=1790261420; cv=none; d=zohomail.com; s=zohoarc; b=QZFTU+cj1am3HE8/DpI5POY03BJ/NFeIRC/CvztRRQDQtpGoCQq375YrMa1AMFmJ7anAVkOJ8ODyKvB4u/PTaRNY+pZXzdSOYVETF3Iv/SbG9o0x6wKIG/W+lvk6bn1mPoYQFb7pMUDrdC9pxIZdZhYGcqLGNbZgj+2FEjLPX8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261420; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qDKqNNDlYfK6wn6XYvmytKMy0kJCAXt7Th72dC2Gd9E=; b=mU6F7hYw1M1lNSHRbfaoA89pC1GvjsI1pe+ma9eYYsIKcysUGmZVg062Pe8Nl3rbmVFv+58VTFhIq2jkfSNbPB0rA3MMmqzTPMqfO2fbB5v3WhJWDQHA641vrG/VCPdEiFajj3+LAkI9rMYbac5iEUleGIuduKG88FTKKDFjqHk= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790261420113661.8326869403064; Thu, 24 Sep 2026 07:50:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9klx-0008VT-To; Thu, 24 Sep 2026 10:50:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9klb-0008Kx-1f for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:46 -0400 Received: from mail-pz2-x0f.google.com ([2607:f8b0:4864:3b::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klY-0005Ek-3E for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:42 -0400 Received: by mail-pz2-x0f.google.com with SMTP id 41be03b00d2f7-cc4c08393dfso1445428a12.3 for ; Thu, 24 Sep 2026 07:49:38 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261378; x=1790866178; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=qDKqNNDlYfK6wn6XYvmytKMy0kJCAXt7Th72dC2Gd9E=; b=vQtHFOSBxlfqvgvikcSoV9CR6mjt8DYxzY69ULq2oYw/rYSS5arL836jJxaS+uT1oq bYESnVfKZkGMcFWJajKpqaL4K16nhy3WbtdycFb2sHP5pk1K7ceMelQEo1K0l3GAXuN4 DHdtteKCnw9YYKjd6GJsp0tH7Q0+LKlUfIEX05RpEnKia+t+b88iK604GQhw+WfueBsT 8iDLf6GM+VBdTUjVZhPknpHO5/P9/NPaHeZIyZkqQXgXpA42qm6y+aq7aAGS04l95dBQ snZX2NU9eK8tfyGW9EW3hHrgVjQCWvn9DFBpWBobpEuUHtQnGn3w1V9rZkwatqdrkWIb aKBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261378; x=1790866178; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=qDKqNNDlYfK6wn6XYvmytKMy0kJCAXt7Th72dC2Gd9E=; b=N61LyUKETsuJykXL1C8dIWe9Ccn8Guy+qTk0vRcitx0dS02zY64vNMNGyYoifZuVHv Luqwm/m8bdx8Gd/7vsdYoG+EYkBlInTpiEmXP9yPtnATJQdMYm5GvnfUIszM4MV72OIG OpuuqmCQ1b9ZOMGA5hDIVf4nXNltvwXIgRMRPpZHkKwK9yiWCYVUk3sd3Z151VfYYKvZ CQVhf7qDoZMWu+kSzDZ9yo9XKoXZ7XD03W+NRRh20jZw4LeyzAnDYQTcbd3uD/Wb6X84 Fz6EmqSfg6RONkRZgU8Tlne+Vfx/FDBR/sQSrTaMEhBgp+Nkmdjkb4vAxlevZaRKTWVN AB8Q== X-Gm-Message-State: AFuF++m/98ydBOu8ik2e1ZuX9VyHTsCmYN1e9AAgwhFNxhA8xVaOSOUl MPMiiODIP1PshdLNMdAbGk9lYi0h6d5WBJeK76tsK9nRER6z1ALjRHqZQrQRXA7oIK8PK+U3rv3 nIO4Y X-Gm-Gg: AYBFou207oLQ43SakWlKJKNPjQTMOqersSXzQU8JO8bfdZiB2Pur4QaeU0p6SKwq1iH Kbehlv8KHwm0mGb75OG+C0TGm87X3pwmrKx8MqOYtlCcJWT+4veG+E9yJB8y1Ban+80EICHvCNR zVAEZJAw77s8m3+Rtg8jm+XjBwgcSBOIBlNBtmSO8dXpdiLzVnul7V/Mi4pGdG5IPPkrfiqteXf 4G49PNZEicTnBlfpJKRikRMYv9nCaa0iQ9PEuFRxYinCSnWg+KTz9zmOQfMHsIawgXMbrEgqRjl oGFoJ9f1muhPDm+WVEvXLPMi22B5EJyLLe+rdrk7UtmWyHy0iL+IveEqjcP1c76m3FIzogFGOQq tbheJbdJ/99vLEuCps/XbXihuWqMG8F4i1c6sy3xHCHSgBBXgHzpzvVZN/mjQJdXIG61Lz8as+y atDWie1NpeHr7hn3jj+RFl+uQ0z354qrmjEYrEUH/QskQsMCqGCgVr+U2R6r0PVrdNrcNWGZH4f EtUjl65Ck/YEoFNPUq63hrSR21OXg== X-Received: by 2002:a05:6a21:9198:b0:3dd:a007:cb2b with SMTP id adf61e73a8af0-3de0e9bd6c6mr2540121637.39.1790261377769; Thu, 24 Sep 2026 07:49:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 6/8] target/mips/tcg: Use gen_mxu_logic for gen_mxu_S32SLT Date: Thu, 24 Sep 2026 07:49:29 -0700 Message-ID: <20260924144931.161335-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::f; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x0f.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261422007158500 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 4b2c264f031..293eeb46c23 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -2313,34 +2313,15 @@ static void gen_mxu_q8slt(DisasContext *ctx, bool s= ltu) * Update XRa with the signed "set less than" comparison of XRb and XRc. * a.k.a. XRa =3D XRb < XRc ? 1 : 0; */ + +static void gen_setcond_lt_i32(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) +{ + tcg_gen_setcond_i32(TCG_COND_LT, d, s1, s2); +} + static void gen_mxu_S32SLT(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same registers -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else { - /* the most general case */ - TCGv_i32 t0 =3D tcg_temp_new_i32(); - TCGv_i32 t1 =3D tcg_temp_new_i32(); - - gen_load_mxu_gpr(t0, XRb); - gen_load_mxu_gpr(t1, XRc); - tcg_gen_setcond_i32(TCG_COND_LT, mxu_gpr[XRa - 1], t0, t1); - } + gen_mxu_logic(ctx, gen_setcond_lt_i32); } =20 /* --=20 2.53.0 From nobody Sat Sep 26 19:16:26 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=1790261459; cv=none; d=zohomail.com; s=zohoarc; b=hUOuqaTGiDh+saNQ9Vi752q1if/R3vr9NMz56vBSWqgQOkOJM1DRas+DhLzm1Jesa3C/oU5hdAJVC/34NZcx3Jdgi5q/od3WuqOQsrRJ7ZqpXo8tYjGjiDcAf7b2mmSwx/+0rdq6/haUittP3y7SoZP7kXaR3+LzJjmP/CH8ejA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261459; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wLANJOhsKzgAIyxNxKclEtyeVwaCU95k4ZeZIB2VDTc=; b=T2D/cNANRQ07Dx6I1jWAt7o5dE1s1B1xX1oEDf1dZisqQ/4y6egNA7hHvDB8imhEOQbAVdepHZ78oikSWbxcjKjINmzmr07l9jW3V2gsZ9ub8FKokloa8ZIu05SdeBUFXlpSdACcCs9RPStqKhwIKnzXVklUF/fGkDKSFMUQK9E= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179026145933594.02152267906729; Thu, 24 Sep 2026 07:50:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9klp-0008Sz-Vm; Thu, 24 Sep 2026 10:49:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9klb-0008Ky-5e for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:46 -0400 Received: from mail-pz2-x0f.google.com ([2607:f8b0:4864:3b::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klY-0005Eu-84 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:42 -0400 Received: by mail-pz2-x0f.google.com with SMTP id d2e1a72fcca58-85469d249c6so1457074b3a.1 for ; Thu, 24 Sep 2026 07:49:39 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261379; x=1790866179; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wLANJOhsKzgAIyxNxKclEtyeVwaCU95k4ZeZIB2VDTc=; b=PcugtzDfVQRWzuWG3Jp5BRLsvlZHwuDcFqMIljrrMMfBpsaOm8C70GVyZjd2t2FaQq itG+5HXOzjFjN7YhLpoudT6ot099nqURW20NiPtZMRT1Li72e+SZwGiBeu0cZYJawfwA VVv57TZuQKhOwAKdsad/crr4FNgCmKq1eAWGiL7nY7ZC7PImiS/eVuMlVPlaDTohDFuR c2pfRj9B4EuRnDCDdK+gwwU1hm5FA/+EWB1nrhUUVkq94T0ssWYQX6alynzqYmstzSBX qetUnEMZopVgOGFiy+vWQpGMBYMTsXcEOkcpiCUNJGAXNVCnyl/EPqi+q1tpc8XhM08A JyTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261379; x=1790866179; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wLANJOhsKzgAIyxNxKclEtyeVwaCU95k4ZeZIB2VDTc=; b=LpluBaf/I+gaP8FFADocKu2bZNUZbCnPZev8nCuZD866a4j1i1Ne9b38pGZeAlQxfu SxgzNJI0WpSNlbyNOOuhKpQxIFzpKuEVyRg0SWvPJEY4gOycyRPThLXmqdx/aza/XNW9 /Dfd8L0O2Ixjt0GEPr4d0ocXulSzl67KsLtFKkEdm58opNvifhYtnvgeBJeBkVg0Sa7S HL3EQrrA5GgW2kb/eYG6wB7iq/h0RtX5HVj3DIjnVTEmmpAg+q9JtrIM+balV9H12AWY 07uGsdpz1RWxQoccnzH/WXRU+ebzFvjapskMcexcsP+qt3iNN4KYEZxYnsHiGzlLTdlP +LMw== X-Gm-Message-State: AFuF++nLQMkeUmPqwsgnR5SJ5QmQPpEQFPy0LY69hh267uxEOhqK9ZQV MhsJzOuWzQZ+twcJBz3r8E6EUdIO9Buoa3OqmxX7gBndSHVBt2G0v/3+sbFrJeD0Biv4TZh/K3P wJ6Fp X-Gm-Gg: AYBFou3qv3twgrd1p936GC3+VM1A1v6lx1aH+q5wZ4d2IuGBjm4fEz3xafeqks7awAX cerFiMejyeUjMEQcVlg/gsglW2nQ/rkPdcL7a2c7k+v79j4g7EWdezxyi5/cLuSap/Q4zo3w0WU YdOJhCLaQ6N4l8dO75F2vK6E1ZEMmxihNZKTExFdCxW1lRkCYS4XdP2mD6bGKADf/Hrx+m6PSm5 YwgKfaZXqG+qtlRTDNafb8wRk6s6+dulJ5GkU6PJjwU0OMylzL6jUMnX+UKHLj7lHs7Pf0E0F5W JTIz2IRL5oD4SiXRUQq1nvrAAGyt8urdiY/fOlCCqIdK1SlKG2KSHCoyj91ooiHCStssvhnPzqn R5KL32pvwzXWUcxHDaWbg5POKDckyFbRA10oCA7fZeFO05qlk/TOUQHi/sGnflP3MfEC2r03al9 Lam9UV2O6D2JcNb9o/lVITi0JX8gw29IRzxylomrG4iJ6PcRLiJ16EJROTQquy5TVFtLoFhcm2d uObXXrIaZdNWEJfUTKKy6D3CAa3NQ== X-Received: by 2002:a05:6a00:2283:b0:86b:43f6:67b7 with SMTP id d2e1a72fcca58-87e9898de76mr2216923b3a.4.1790261378580; Thu, 24 Sep 2026 07:49:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 7/8] target/mips/tcg: Use gen_mxu_logic for gen_mxu_S32CPS Date: Thu, 24 Sep 2026 07:49:30 -0700 Message-ID: <20260924144931.161335-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::f; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x0f.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261460387158500 Use movcond instead of a pair of branches to perform the computation, packed in a new gen_cps_i32. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 42 +++++++++------------------------ 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 293eeb46c23..a38f4da12ba 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -2640,39 +2640,19 @@ static void gen_mxu_s32movzn(DisasContext *ctx, TCG= Cond cond) * Update XRa if XRc < 0 by value of 0 - XRb * else XRa =3D XRb */ + +static void gen_cps_i32(TCGv_i32 a, TCGv_i32 b, TCGv_i32 c) +{ + TCGv_i32 n =3D tcg_temp_new_i32(); + TCGv_i32 z =3D tcg_constant_i32(0); + + tcg_gen_neg_i32(n, b); + tcg_gen_movcond_i32(TCG_COND_LT, a, c, z, n, b); +} + static void gen_mxu_S32CPS(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely(XRb =3D=3D 0)) { - /* XRc make no sense 0 - 0 =3D 0 -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRc =3D=3D 0)) { - /* condition always false -> just move XRb to XRa */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - TCGv_i32 t0 =3D tcg_temp_new_i32(); - TCGLabel *l_not_less =3D gen_new_label(); - TCGLabel *l_done =3D gen_new_label(); - - tcg_gen_brcondi_i32(TCG_COND_GE, mxu_gpr[XRc - 1], 0, l_not_less); - tcg_gen_neg_i32(t0, mxu_gpr[XRb - 1]); - tcg_gen_br(l_done); - gen_set_label(l_not_less); - gen_load_mxu_gpr(t0, XRb); - gen_set_label(l_done); - gen_store_mxu_gpr(t0, XRa); - } + gen_mxu_logic(ctx, gen_cps_i32); } =20 /* --=20 2.53.0 From nobody Sat Sep 26 19:16:26 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=1790261465; cv=none; d=zohomail.com; s=zohoarc; b=QL1gKzZBEhWq7Bat4ovHcQt9uwngiKRZA7MgC6f3F4bxkHllOM1jJKpv4BjiGDN73P7IqpX0Jo/dCyCO7vUqn53iFuHuZAk73iiI453NtFJdssYiqOTW5cXM5qcCt9/tBkFJ+zd6fifSqsHga7LGHtqkya2ebvcoI1/IT366BkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790261465; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Uv+G7cyiouAqurlZMl2qt+7AlS770yvplz85F2mPwwg=; b=QaEZvxuXHZbYIx6xyMlWi8puW2QAXPRu9AznJHpJF9b22Dr50q/KGzmYnW3jRbUZ98nF/Lo/ZSsqx7paVfLyqyY+aK8qxpICgfaQVhDWTP0LZqRoRcR8EQ9yMc0j3g+PEOqoCuJQ3cEpsYYbRRuYp/1U+/K2QhJ9BlZPUvoarO8= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790261465333962.3594850901592; Thu, 24 Sep 2026 07:51:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9kly-00005g-KZ; Thu, 24 Sep 2026 10:50:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9kld-0008Ml-MW for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:46 -0400 Received: from mail-pz2-x0f.google.com ([2607:f8b0:4864:3b::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x9klY-0005F3-Uz for qemu-devel@nongnu.org; Thu, 24 Sep 2026 10:49:44 -0400 Received: by mail-pz2-x0f.google.com with SMTP id d2e1a72fcca58-868b2e5be4eso826238b3a.3 for ; Thu, 24 Sep 2026 07:49:40 -0700 (PDT) Received: from stoup (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-87d1dad3978sm3209818b3a.34.2026.09.24.07.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 07:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790261380; x=1790866180; 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:content-type; bh=Uv+G7cyiouAqurlZMl2qt+7AlS770yvplz85F2mPwwg=; b=X4Mb1MetAImNHWa7kUSvcpVR/BeFuJwiYO6+cW2aHk16xaqeYtnTn4eGPKNBEa2MXS ZUEZg5z1x1+P5uldgE2R7q7gVd0n79RxVAWXt72UP6ukmestCAdSTS6t6nZgebj27mSS hk8QrRugV4xG5QUg3dVymUgmT4VEw3FARSEB6EBHV/nIWBVNhZvKpwtDCGFGOrKOTqk/ RUqE3aJuanNke1i9FbQnAnLfTybVDcSxNO+IrX+t7o//w+z2hfmlt0wYkV5IE93lGgZU 8EDOpu7O/mWRulADDNxjNC+oEGY5h/TKT08CeUtVUV6UOitKW17YIZGSg9JNtUV3T2Qs kvQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790261380; x=1790866180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Uv+G7cyiouAqurlZMl2qt+7AlS770yvplz85F2mPwwg=; b=q88Tnhel2ut5sCp3Xyrbi06KlX/TDB7H1RvEXxNgDUrq5KIJMLRy+rPuRQItfBPADe acKIZeV3mf1CTsnlkiNgw0ir2eTxwc70TZg1vtwPRZLnTH7qZGv0bficw3V6lJfWAOJm L4VOgQMT+bBU4fnB+ZuXVkUURPpavytHamR3L1ZBva8TFwQynVxjMhseaM6f8V4in4Vc loVIIptn3LY5LLKPxYZkx1wtZ0F2a/3rCnCrd/8rOz6u/1/l1Z/IMtMsy3toTtYGoRxz 0HcaINgCjhMPG51lYn98AqkMNhqrJ8TfMeulB3QHh5Pm8uAOFicnM1sdFs7t6ytTCnYU bfqg== X-Gm-Message-State: AFuF++lLB36eWXN636KCnrBlLJRW0eMvVbYsjeg+oT0DNx/PDG1Akfjs aVa2myiqcV9bySSM0FNGmabILBBqbI/SXSh75DHuvGe1whVRSjGw/m+4oxae8YK168GptMS7ms5 sp9BU X-Gm-Gg: AYBFou0DPy/5M57VT40IN/9mMSr9Y/h8DD3nL/DqMEFRH2NjZPAgWlpycKYPqlwhmyj IL/LHNs1gThTXNJQiXNUncQnD0JAH4UFMsaAxCVS/CmPPBzO9FFVhcZ5MIdDADlVK/4zryNnVpa sehQ1hWcWsofZqsi9fic0YmmIebELgo/AYZhSeW31hY8/ZTMSNQ9KUGvzxe3y3OJezIsYnEENyX UsFq8P4wPdydi3JwDgZ5zk8sVqSmnsqVDjM4R6RJ28eitSsct6i+JnkRHEEu8RJABkzlY2RQrMD MFD9i8rB4qM/31WxOPNPqdke1P36xVRi8tKNdkQIyp3M/d46KFN9XKtnYIS9/UHn0QPm/k2lvYr GXk+yNhFI78dJ0wNZKIyTenKXRSGNp3yiqj+uiPXIW12HZpmS08iRYEYyy2Rrhsj4S0CMwdNTNq G3IecKtmBa7IdQKG/5r4RQjwlI//ENAklAA8RahfXcrE+uKJVzAz6Djs0p92fEfCDW6hCK3C9Up L9uQ5DO+/9uUX4u+y9SehMsOF41pK00lR8CHLnVKoiMrY9hqvQ= X-Received: by 2002:a05:6a00:6ca5:b0:878:3507:8d62 with SMTP id d2e1a72fcca58-87e9dfafae9mr2483265b3a.41.1790261379306; Thu, 24 Sep 2026 07:49:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller Subject: [PULL 8/8] target/hppa/tcg: Always initialize DisasCond.{a0,a1} Date: Thu, 24 Sep 2026 07:49:31 -0700 Message-ID: <20260924144931.161335-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924144931.161335-1-richard.henderson@linaro.org> References: <20260924144931.161335-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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:3b::f; envelope-from=richard.henderson@linaro.org; helo=mail-pz2-x0f.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1790261465975158500 Content-Type: text/plain; charset="utf-8" Forthcoming tcg improvements will diagnose the passed null pointer with --enable-ubsan: ../src/target/hppa/translate.c:579:9: runtime error: null pointer passed as= argument 3, which is declared to never be null ../src/target/hppa/translate.c:579:9: runtime error: null pointer passed as= argument 4, which is declared to never be null Reviewed-by: Helge Deller Signed-off-by: Richard Henderson --- target/hppa/translate.c | 72 ++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 002189ddfbd..41300c0dd73 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -339,30 +339,30 @@ static void set_insn_breg(DisasContext *ctx, int breg) tcg_set_insn_start_param(ctx->base.insn_start, 2, breg); } =20 -static DisasCond cond_make_f(void) +static DisasCond cond_make_f(DisasContext *ctx) { return (DisasCond){ .c =3D TCG_COND_NEVER, - .a0 =3D NULL, - .a1 =3D NULL, + .a0 =3D ctx->zero, + .a1 =3D ctx->zero, }; } =20 -static DisasCond cond_make_t(void) +static DisasCond cond_make_t(DisasContext *ctx) { return (DisasCond){ .c =3D TCG_COND_ALWAYS, - .a0 =3D NULL, - .a1 =3D NULL, + .a0 =3D ctx->zero, + .a1 =3D ctx->zero, }; } =20 -static DisasCond cond_make_n(void) +static DisasCond cond_make_n(DisasContext *ctx) { return (DisasCond){ .c =3D TCG_COND_NE, .a0 =3D cpu_psw_n, - .a1 =3D tcg_constant_i64(0) + .a1 =3D ctx->zero, }; } =20 @@ -562,7 +562,7 @@ static void nullify_over(DisasContext *ctx) =20 tcg_gen_brcond_i64(ctx->null_cond.c, ctx->null_cond.a0, ctx->null_cond.a1, ctx->null_lab); - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); } } =20 @@ -580,7 +580,7 @@ static void nullify_save(DisasContext *ctx) ctx->null_cond.a0, ctx->null_cond.a1); ctx->psw_n_nonzero =3D true; } - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); } =20 /* Set a PSW[N] to X. The intention is that this is used immediately @@ -626,7 +626,7 @@ static bool nullify_end(DisasContext *ctx) label we have the proper value in place. */ nullify_save(ctx); gen_set_label(null_lab); - ctx->null_cond =3D cond_make_n(); + ctx->null_cond =3D cond_make_n(ctx); } if (status =3D=3D DISAS_NORETURN) { ctx->base.is_jmp =3D DISAS_NEXT; @@ -766,7 +766,7 @@ static bool gen_excp_iir(DisasContext *ctx, int exc) DisasDelayException *e =3D delay_excp(ctx, exc); tcg_gen_brcond_i64(tcg_invert_cond(ctx->null_cond.c), ctx->null_cond.a0, ctx->null_cond.a1, e->lab); - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); } return true; } @@ -859,7 +859,7 @@ static DisasCond do_cond(DisasContext *ctx, unsigned cf= , bool d, =20 switch (cf >> 1) { case 0: /* Never / TR (0 / 1) */ - cond =3D cond_make_f(); + cond =3D cond_make_f(ctx); break; case 1: /* =3D / <> (Z / !Z) */ cond =3D cond_make_vi(zero_cond, res, zero_imm); @@ -984,7 +984,7 @@ static DisasCond do_log_cond(DisasContext *ctx, unsigne= d cf, bool d, case 4: /* undef, C */ case 5: /* undef, C & !Z */ case 6: /* undef, V */ - return cf & 1 ? cond_make_t() : cond_make_f(); + return cf & 1 ? cond_make_t(ctx) : cond_make_f(ctx); case 1: /* =3D=3D / <> */ tc =3D d ? TCG_COND_EQ : TCG_COND_TSTEQ; imm =3D d ? 0 : UINT32_MAX; @@ -1034,7 +1034,7 @@ static DisasCond do_sed_cond(DisasContext *ctx, unsig= ned orig, bool d, } =20 /* Similar, but for unit zero conditions. */ -static DisasCond do_unit_zero_cond(unsigned cf, bool d, TCGv_i64 res) +static DisasCond do_unit_zero_cond(DisasContext *ctx, unsigned cf, bool d,= TCGv_i64 res) { TCGv_i64 tmp; uint64_t d_repl =3D d ? 0x0000000100000001ull : 1; @@ -1058,7 +1058,7 @@ static DisasCond do_unit_zero_cond(unsigned cf, bool = d, TCGv_i64 res) } if (ones =3D=3D 0) { /* Undefined, or 0/1 (never/always). */ - return cf & 1 ? cond_make_t() : cond_make_f(); + return cf & 1 ? cond_make_t(ctx) : cond_make_f(ctx); } =20 /* @@ -1171,7 +1171,7 @@ static void gen_tc(DisasContext *ctx, DisasCond *cond) e =3D delay_excp(ctx, EXCP_COND); tcg_gen_brcond_i64(cond->c, cond->a0, cond->a1, e->lab); /* In the non-trap path, the condition is known false. */ - *cond =3D cond_make_f(); + *cond =3D cond_make_f(ctx); break; } } @@ -1473,7 +1473,7 @@ static void do_unit_addsub(DisasContext *ctx, unsigne= d rt, TCGv_i64 in1, } else { tcg_gen_sub_i64(dest, in1, in2); } - cond =3D do_unit_zero_cond(cf, d, dest); + cond =3D do_unit_zero_cond(ctx, cf, d, dest); } else { TCGv_i64 cb =3D tcg_temp_new_i64(); =20 @@ -2131,7 +2131,7 @@ static void do_page_zero(DisasContext *ctx) =20 static bool trans_nop(DisasContext *ctx, arg_nop *a) { - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2145,7 +2145,7 @@ static bool trans_sync(DisasContext *ctx, arg_sync *a) /* No point in nullifying the memory barrier. */ tcg_gen_mb(TCG_BAR_SC | TCG_MO_ALL); =20 - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2157,7 +2157,7 @@ static bool trans_mfia(DisasContext *ctx, arg_mfia *a) tcg_gen_andi_i64(dest, dest, -4); =20 save_gpr(ctx, a->t, dest); - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2172,7 +2172,7 @@ static bool trans_mfsp(DisasContext *ctx, arg_mfsp *a) =20 save_gpr(ctx, rt, t0); =20 - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2217,7 +2217,7 @@ static bool trans_mfctl(DisasContext *ctx, arg_mfctl = *a) save_gpr(ctx, rt, tmp); =20 done: - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2257,7 +2257,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl = *a) tcg_gen_andi_i64(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); =20 - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2331,7 +2331,7 @@ static bool trans_mtsarcm(DisasContext *ctx, arg_mtsa= rcm *a) tcg_gen_andi_i64(tmp, tmp, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); =20 - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2348,7 +2348,7 @@ static bool trans_ldsid(DisasContext *ctx, arg_ldsid = *a) #endif save_gpr(ctx, a->t, dest); =20 - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2512,7 +2512,7 @@ static bool trans_nop_addrx(DisasContext *ctx, arg_ld= st *a) tcg_gen_add_i64(dest, src1, src2); save_gpr(ctx, a->b, dest); } - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2754,7 +2754,7 @@ static bool trans_lci(DisasContext *ctx, arg_lci *a) since the entire address space is coherent. */ save_gpr(ctx, a->t, ctx->zero); =20 - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -2831,7 +2831,7 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf_d = *a) unsigned rt =3D a->t; =20 if (rt =3D=3D 0) { /* NOP */ - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } if (r2 =3D=3D 0) { /* COPY */ @@ -2842,7 +2842,7 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf_d = *a) } else { save_gpr(ctx, rt, cpu_gr[r1]); } - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } #ifndef CONFIG_USER_ONLY @@ -2910,7 +2910,7 @@ static bool trans_uxor(DisasContext *ctx, arg_rrr_cf_= d *a) tcg_gen_xor_i64(dest, tcg_r1, tcg_r2); save_gpr(ctx, a->t, dest); =20 - ctx->null_cond =3D do_unit_zero_cond(a->cf, a->d, dest); + ctx->null_cond =3D do_unit_zero_cond(ctx, a->cf, a->d, dest); return nullify_end(ctx); } =20 @@ -2936,7 +2936,7 @@ static bool do_uaddcm(DisasContext *ctx, arg_rrr_cf_d= *a, bool is_tc) tcg_gen_subi_i64(tmp, tmp, 1); } save_gpr(ctx, a->t, tmp); - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -3460,7 +3460,7 @@ static bool trans_ldil(DisasContext *ctx, arg_ldil *a) =20 tcg_gen_movi_i64(tcg_rt, a->i); save_gpr(ctx, a->t, tcg_rt); - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -3471,7 +3471,7 @@ static bool trans_addil(DisasContext *ctx, arg_addil = *a) =20 tcg_gen_addi_i64(tcg_r1, tcg_rt, a->i); save_gpr(ctx, 1, tcg_r1); - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -3487,7 +3487,7 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a) tcg_gen_addi_i64(tcg_rt, cpu_gr[a->b], a->i); } save_gpr(ctx, a->t, tcg_rt); - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); return true; } =20 @@ -4689,7 +4689,7 @@ static void hppa_tr_tb_start(DisasContextBase *dcbase= , CPUState *cs) DisasContext *ctx =3D container_of(dcbase, DisasContext, base); =20 /* Seed the nullification status from PSW[N], as saved in TB->FLAGS. = */ - ctx->null_cond =3D cond_make_f(); + ctx->null_cond =3D cond_make_f(ctx); ctx->psw_n_nonzero =3D false; if (ctx->tb_flags & PSW_N) { ctx->null_cond.c =3D TCG_COND_ALWAYS; --=20 2.53.0