Commit 5bf06a9528698aa426a32f16e1ae3098b0239d63
1 parent
66029f6a
target-ppc: fix mullw/mullwo
Based on patch by Julian Seward. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5379 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
5 additions
and
1 deletions
target-ppc/op.c
| @@ -798,7 +798,11 @@ void OPPROTO op_mulli (void) | @@ -798,7 +798,11 @@ void OPPROTO op_mulli (void) | ||
| 798 | /* multiply low word */ | 798 | /* multiply low word */ |
| 799 | void OPPROTO op_mullw (void) | 799 | void OPPROTO op_mullw (void) |
| 800 | { | 800 | { |
| 801 | +#if defined(TARGET_PPC64) | ||
| 802 | + T0 = (int64_t)(int32_t)T0 * (int64_t)(int32_t)T1; | ||
| 803 | +#else | ||
| 801 | T0 = (int32_t)(T0 * T1); | 804 | T0 = (int32_t)(T0 * T1); |
| 805 | +#endif | ||
| 802 | RETURN(); | 806 | RETURN(); |
| 803 | } | 807 | } |
| 804 | 808 |
target-ppc/op_helper.c
| @@ -227,7 +227,7 @@ void do_divduo (void) | @@ -227,7 +227,7 @@ void do_divduo (void) | ||
| 227 | 227 | ||
| 228 | void do_mullwo (void) | 228 | void do_mullwo (void) |
| 229 | { | 229 | { |
| 230 | - int64_t res = (int64_t)T0 * (int64_t)T1; | 230 | + int64_t res = (int64_t)(int32_t)T0 * (int64_t)(int32_t)T1; |
| 231 | 231 | ||
| 232 | if (likely((int32_t)res == res)) { | 232 | if (likely((int32_t)res == res)) { |
| 233 | xer_ov = 0; | 233 | xer_ov = 0; |