From nobody Mon Nov 25 23:20:33 2024 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=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1711228598; cv=none; d=zohomail.com; s=zohoarc; b=MitIH8quCqBOqMyss7mftRum7tCBsvAcljKo3AwmsKfCmWYzrwcEU/qEiXbMAieOQDH7m05x5dNINudQZWJKNAswh8iIYip3GvdcTf1M7nRyBGtHzqKyYm7hz7wE9sqRi/5YDz7+es3M0CkJRs0zvHODjNZwdetvsbN+pTUQ43s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711228598; h=Content-Type:Date:Date:From:From: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:Cc; bh=DfW8Tz65Ulvc4NGEYe9Q4nGxSObZNnBzeQtA/U7Bw+w=; b=JGpwAucxiaLNzjr0db7GnuqxKYWGTQZmHsksw5sbeoXLtuUTtgffxPpsZs7fffPCRLnNimcZmmcF+Guv12QEITDww3ESVr/Iv8Wpw4mWx/3oydmjG6VA2t9MEzwToglRnu9sIpR8owYOHbRQY1DjmTjcOxdWmm5uq0gtd1Fnno8= 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 1711228598346924.7124530038394; Sat, 23 Mar 2024 14:16:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro8iN-0006sc-0K; Sat, 23 Mar 2024 17:15:43 -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 1ro8iL-0006sM-Jm for qemu-devel@nongnu.org; Sat, 23 Mar 2024 17:15:41 -0400 Received: from sin.source.kernel.org ([145.40.73.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ro8iJ-0006k9-6x for qemu-devel@nongnu.org; Sat, 23 Mar 2024 17:15:41 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 54FF0CE000E; Sat, 23 Mar 2024 21:15:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71101C433F1; Sat, 23 Mar 2024 21:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711228524; bh=4LtswzyTGJgbT0Yx5dz7Zyeh3dJL9PInNwccyHY2vgE=; h=Date:From:To:Subject:From; b=fgg6YFGJ0i2MMxpq8nV9dlZLBP2cTKleE5UkXzAq3XNGrHRKgTelyzckxGL5Kh/00 hfnbL7SGc9FiAu2eATbMgA3VsNyjcEk8EblscaZQkoBLMCyMlDA8YO6IJ+w002YM3Y w1jX6VDzK00MOhqvzxaK/xhNitJJZcMe9nA0bPbBZBGSEdtuRxEJL2WhoN1a+7CZT5 o1cEyL8Iq/iEGsM4p0XNJ7EdaelHUxHVmmlJIYzTKw+YITp+7GIEk8HFOyWbFLRpaZ ZtDV9WuqmBECpX6/80iXO80ip6iGd2WWdcLhzGDXM0CvUsX+Ts/KpYbRQq4LkkIp3C CsR/iY4QB2oGQ== Date: Sat, 23 Mar 2024 22:15:20 +0100 From: Helge Deller To: Richard Henderson , svens@stackframe.org, qemu-devel@nongnu.org Subject: [PATCH][RFC] target/hppa: Avoid nullification for uaddcmt instruction Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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=145.40.73.55; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.222, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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 @kernel.org) X-ZM-MESSAGEID: 1711228599766100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The uaddcmt (UNIT ADD COMPLEMENT AND TRAP ON CONDITION) instruction triggers a trap if the condition is true, and stores the result of the addition in the target register otherwise. It does not use the condition to nullify the following instruction, so drop the calculated condition and do not install it as null_cond. This patch is not tested and as such sent as RFC. I just stumbled over the apparently wrong behaviour while debugging the uaddcm instruction. Signed-off-by: Helge Deller diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 46b2d6508d..6088e9bbf3 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1363,7 +1363,11 @@ static void do_unit(DisasContext *ctx, unsigned rt, = TCGv_i64 in1, save_gpr(ctx, rt, dest); =20 cond_free(&ctx->null_cond); - ctx->null_cond =3D cond; + if (is_tc) { + cond_free(&cond); + } else { + ctx->null_cond =3D cond; + } } }