qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] target/hppa: add unit conditions for wide mode
@ 2024-03-21 18:42 Sven Schnelle
  2024-03-21 18:42 ` [PATCH 2/3] target/hppa: sub: fix trap on overflow for narrow mode Sven Schnelle
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Sven Schnelle @ 2024-03-21 18:42 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel, Helge Deller, Sven Schnelle

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



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-21 21:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-21 18:42 [PATCH 1/3] target/hppa: add unit conditions for wide mode Sven Schnelle
2024-03-21 18:42 ` [PATCH 2/3] target/hppa: sub: fix trap on overflow for narrow mode Sven Schnelle
2024-03-21 20:03   ` Richard Henderson
2024-03-21 20:08     ` Sven Schnelle
2024-03-21 18:42 ` [PATCH 3/3] target/hppa: add: " Sven Schnelle
2024-03-21 20:04   ` Richard Henderson
2024-03-21 19:58 ` [PATCH 1/3] target/hppa: add unit conditions for wide mode Richard Henderson
2024-03-21 20:10   ` Sven Schnelle
2024-03-21 21:06     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).