qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 07/17] m68k: add DBcc instruction.


From: Andreas Schwab
Subject: [Qemu-devel] Re: [PATCH 07/17] m68k: add DBcc instruction.
Date: Sun, 31 May 2009 00:00:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux)

Laurent Vivier <address@hidden> writes:

> +    tmp = tcg_temp_new();
> +    tcg_gen_ext16s_i32(tmp, reg);
> +    tcg_gen_addi_i32(tmp, tmp, -1);
> +    gen_partset_reg(OS_WORD, reg, tmp);
> +    tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 0, l1);

The counter needs to be compared with -1, not 0.

Andreas.
---
>From 07f10a1b4a4aa4a54468e1106a4bbc28c5ada45e Mon Sep 17 00:00:00 2001
From: Andreas Schwab <address@hidden>
Date: Sat, 30 May 2009 23:52:11 +0200
Subject: [PATCH] m68k: fix decoding of dbcc

The counter needs to be compared with -1, not 0.

Signed-off-by: Andreas Schwab <address@hidden>
---
 target-m68k/translate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 9d68b02..ea6b34b 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -942,7 +942,7 @@ DISAS_INSN(dbcc)
     tcg_gen_ext16s_i32(tmp, reg);
     tcg_gen_addi_i32(tmp, tmp, -1);
     gen_partset_reg(OS_WORD, reg, tmp);
-    tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 0, l1);
+    tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, -1, l1);
     gen_jmp_tb(s, 1, base + offset);
     gen_set_label(l1);
     gen_jmp_tb(s, 0, s->pc);
-- 
1.6.3.1

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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