]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
target-mips: fix for sign-issue in MULQ_W helper
authorPetar Jovanovic <petarj@mips.com>
Thu, 7 Feb 2013 18:36:09 +0000 (19:36 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 4 Apr 2013 21:31:57 +0000 (16:31 -0500)
Correct sign-propagation before multiplication in MULQ_W helper.
The change also fixes previously incorrect expected values in the
tests for MULQ_RS.W and MULQ_S.W.

Signed-off-by: Petar Jovanovic <petarj@mips.com>
Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit a345481baa2b2fb3d54f8c9ddb58dfcaf75786df)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-mips/dsp_helper.c
tests/tcg/mips/mips32-dspr2/mulq_rs_w.c
tests/tcg/mips/mips32-dspr2/mulq_s_w.c

index 6781da8214c841da698309290acf73f641154035..841f47b91db9ac999cd9fa77a377a369a7e8303d 100644 (file)
@@ -2689,7 +2689,7 @@ MAQ_SA_W(maq_sa_w_phr, 0);
 target_ulong helper_##name(target_ulong rs, target_ulong rt,   \
                            CPUMIPSState *env)                  \
 {                                                              \
-    uint32_t rs_t, rt_t;                                       \
+    int32_t rs_t, rt_t;                                        \
     int32_t tempI;                                             \
     int64_t tempL;                                             \
                                                                \
index 669405faf1be0ea30a72eada1b5d41fc72fc258f..7ba633bc17f779b55460c3ded09b71b71923a562 100644 (file)
@@ -8,7 +8,7 @@ int main()
 
     rs = 0x80001234;
     rt = 0x80004321;
-    result = 0x80005555;
+    result = 0x7FFFAAAB;
 
     __asm
         ("mulq_rs.w %0, %1, %2\n\t"
index df148b7ffbf0a7cf241c4cdc1b80866058bf957d..9c2be06cc08afbd888890130ca5142f9e96af64e 100644 (file)
@@ -8,7 +8,7 @@ int main()
 
     rs = 0x80001234;
     rt = 0x80004321;
-    result = 0x80005555;
+    result = 0x7FFFAAAB;
 
     __asm
         ("mulq_s.w %0, %1, %2\n\t"