diff mbox

[for-2.8] target-m68k: fix muluw/mulsw

Message ID 1479976802-21696-1-git-send-email-laurent@vivier.eu (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Vivier Nov. 24, 2016, 8:40 a.m. UTC
"The multiplier and multiplicand are both word operands, and the result
is a long-word operand."

So compute flags on a long-word result, not on a word result.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target-m68k/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Henderson Nov. 24, 2016, 9:42 a.m. UTC | #1
On 11/24/2016 09:40 AM, Laurent Vivier wrote:
> "The multiplier and multiplicand are both word operands, and the result
> is a long-word operand."
>
> So compute flags on a long-word result, not on a word result.
>
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  target-m68k/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index d2d6816..d6ed883 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -1186,7 +1186,7 @@  DISAS_INSN(mulw)
     SRC_EA(env, src, OS_WORD, sign, NULL);
     tcg_gen_mul_i32(tmp, tmp, src);
     tcg_gen_mov_i32(reg, tmp);
-    gen_logic_cc(s, tmp, OS_WORD);
+    gen_logic_cc(s, tmp, OS_LONG);
 }
 
 DISAS_INSN(divw)