Commit 5bf06a9528698aa426a32f16e1ae3098b0239d63

Authored by aurel32
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
target-ppc/op.c
... ... @@ -798,7 +798,11 @@ void OPPROTO op_mulli (void)
798 798 /* multiply low word */
799 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 804 T0 = (int32_t)(T0 * T1);
  805 +#endif
802 806 RETURN();
803 807 }
804 808  
... ...
target-ppc/op_helper.c
... ... @@ -227,7 +227,7 @@ void do_divduo (void)
227 227  
228 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 232 if (likely((int32_t)res == res)) {
233 233 xer_ov = 0;
... ...