Skip to contentSkip to conversation

[5379] target-ppc: fix mullw/mullwo

Qemu-devel Aurelien Jarno 1 participant 1 message Oct 1, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5379

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5379
Author:   aurel32
Date:     2008-10-01 21:45:18 +0000 (Wed, 01 Oct 2008)

Log Message:
-----------
target-ppc: fix mullw/mullwo

Based on patch by Julian Seward.

Modified Paths:
--------------
trunk/target-ppc/op.c
trunk/target-ppc/op_helper.c

Modified: trunk/target-ppc/op.c
===================================================================

target-ppc/op.c +4 -0
@@ -798,7 +798,11 @@
 /* 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();
 }
 

Modified: trunk/target-ppc/op_helper.c
===================================================================

target-ppc/op_helper.c +1 -1
@@ -227,7 +227,7 @@
 
 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;