From: Helge Deller <deller@kernel.org>
To: Richard Henderson <richard.henderson@linaro.org>,
svens@stackframe.org, qemu-devel@nongnu.org
Subject: [PATCH][RFC] target/hppa: Avoid nullification for uaddcmt instruction
Date: Sat, 23 Mar 2024 22:15:20 +0100 [thread overview]
Message-ID: <Zf9GaFSsAJ5AAzKk@p100> (raw)
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;
+ }
}
}
next reply other threads:[~2024-03-23 21:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-23 21:15 Helge Deller [this message]
2024-03-24 17:13 ` [PATCH][RFC] target/hppa: Avoid nullification for uaddcmt instruction Richard Henderson
2024-03-24 17:20 ` Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zf9GaFSsAJ5AAzKk@p100 \
--to=deller@kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=svens@stackframe.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.