From 5bf06a9528698aa426a32f16e1ae3098b0239d63 Mon Sep 17 00:00:00 2001 From: aurel32 Date: Wed, 1 Oct 2008 21:45:18 +0000 Subject: [PATCH] target-ppc: fix mullw/mullwo Based on patch by Julian Seward. Signed-off-by: Aurelien Jarno git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5379 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/op.c | 4 ++++ target-ppc/op_helper.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/target-ppc/op.c b/target-ppc/op.c index 64166595cf..4ab0f00433 100644 --- a/target-ppc/op.c +++ b/target-ppc/op.c @@ -798,7 +798,11 @@ void OPPROTO op_mulli (void) /* multiply low word */ void OPPROTO op_mullw (void) { +#if defined(TARGET_PPC64) + T0 = (int64_t)(int32_t)T0 * (int64_t)(int32_t)T1; +#else T0 = (int32_t)(T0 * T1); +#endif RETURN(); } diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 46e9b7ab6c..d398640278 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -227,7 +227,7 @@ void do_divduo (void) void do_mullwo (void) { - int64_t res = (int64_t)T0 * (int64_t)T1; + int64_t res = (int64_t)(int32_t)T0 * (int64_t)(int32_t)T1; if (likely((int32_t)res == res)) { xer_ov = 0;