[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] target/hppa: add unit conditions for wide mode
From: |
Sven Schnelle |
Subject: |
[PATCH 1/3] target/hppa: add unit conditions for wide mode |
Date: |
Thu, 21 Mar 2024 19:42:26 +0100 |
Wide mode provides two more conditions, add them.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
target/hppa/translate.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 8a87996fc1..f493e207e1 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -963,11 +963,22 @@ static DisasCond do_unit_cond(unsigned cf, bool d,
TCGv_i64 res,
switch (cf >> 1) {
case 0: /* never / TR */
- case 1: /* undefined */
- case 5: /* undefined */
cond = cond_make_f();
break;
+ case 1:
+ if (d) {
+ tmp = tcg_temp_new_i64();
+ tcg_gen_subi_i64(tmp, res, d_repl * 0x00000001u);
+ tcg_gen_andc_i64(tmp, tmp, res);
+ tcg_gen_andi_i64(tmp, tmp, d_repl * 0x80000000u);
+ cond = cond_make_0(TCG_COND_NE, tmp);
+ } else {
+ /* undefined */
+ cond = cond_make_f();
+ }
+ break;
+
case 2: /* SBZ / NBZ */
/* See hasless(v,1) from
* https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord
@@ -992,6 +1003,16 @@ static DisasCond do_unit_cond(unsigned cf, bool d,
TCGv_i64 res,
cond = cond_make_0(TCG_COND_NE, cb);
break;
+ case 5:
+ if (d) {
+ tcg_gen_andi_i64(cb, cb, d_repl * 0x80000000u);
+ cond = cond_make_0(TCG_COND_NE, cb);
+ } else {
+ /* undefined */
+ cond = cond_make_f();
+ }
+ break;
+
case 6: /* SBC / NBC */
tcg_gen_andi_i64(cb, cb, d_repl * 0x80808080u);
cond = cond_make_0(TCG_COND_NE, cb);
--
2.43.2
- [PATCH 1/3] target/hppa: add unit conditions for wide mode,
Sven Schnelle <=