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
This commit is contained in:
aurel32 2008-10-01 21:45:18 +00:00
parent 66029f6a2f
commit 5bf06a9528
2 changed files with 5 additions and 1 deletions

View File

@ -798,7 +798,11 @@ void OPPROTO op_mulli (void)
/* multiply low word */ /* multiply low word */
void OPPROTO op_mullw (void) 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); T0 = (int32_t)(T0 * T1);
#endif
RETURN(); RETURN();
} }

View File

@ -227,7 +227,7 @@ void do_divduo (void)
void do_mullwo (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)) { if (likely((int32_t)res == res)) {
xer_ov = 0; xer_ov = 0;