qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH][RFC] target/hppa: Avoid nullification for uaddcmt instruction


From: Helge Deller
Subject: [PATCH][RFC] target/hppa: Avoid nullification for uaddcmt instruction
Date: Sat, 23 Mar 2024 22:15:20 +0100

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 <deller@gmx.de>

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);
 
         cond_free(&ctx->null_cond);
-        ctx->null_cond = cond;
+        if (is_tc) {
+            cond_free(&cond);
+        } else {
+            ctx->null_cond = cond;
+        }
     }
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]