From: Petar Jovanovic Date: Thu, 7 Feb 2013 18:36:09 +0000 (+0100) Subject: target-mips: fix for sign-issue in MULQ_W helper X-Git-Tag: v1.4.1~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b09a67316484af24427a7174b65531e9c0b6e6b4;p=thirdparty%2Fqemu.git target-mips: fix for sign-issue in MULQ_W helper 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 Richard Henderson Signed-off-by: Aurelien Jarno (cherry picked from commit a345481baa2b2fb3d54f8c9ddb58dfcaf75786df) Signed-off-by: Michael Roth --- diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c index 6781da8214c..841f47b91db 100644 --- a/target-mips/dsp_helper.c +++ b/target-mips/dsp_helper.c @@ -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; \ \ diff --git a/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c b/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c index 669405faf1b..7ba633bc17f 100644 --- a/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c +++ b/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c @@ -8,7 +8,7 @@ int main() rs = 0x80001234; rt = 0x80004321; - result = 0x80005555; + result = 0x7FFFAAAB; __asm ("mulq_rs.w %0, %1, %2\n\t" diff --git a/tests/tcg/mips/mips32-dspr2/mulq_s_w.c b/tests/tcg/mips/mips32-dspr2/mulq_s_w.c index df148b7ffbf..9c2be06cc08 100644 --- a/tests/tcg/mips/mips32-dspr2/mulq_s_w.c +++ b/tests/tcg/mips/mips32-dspr2/mulq_s_w.c @@ -8,7 +8,7 @@ int main() rs = 0x80001234; rt = 0x80004321; - result = 0x80005555; + result = 0x7FFFAAAB; __asm ("mulq_s.w %0, %1, %2\n\t"