summaryrefslogtreecommitdiff
path: root/target-mips/dsp_helper.c
diff options
context:
space:
mode:
authorPetar Jovanovic <petarj@mips.com>2013-02-06 18:05:25 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-04-04 16:31:23 -0500
commit79a4dd4085fceaaf23b619e1e269478306226f16 (patch)
treefd05e552be85e989b2fd3b5058847a3a8f470e05 /target-mips/dsp_helper.c
parent57e929c19c5aec8cbb572ec218ff6cbe250f5fc1 (diff)
downloadqemu-79a4dd4085fceaaf23b619e1e269478306226f16.tar.gz
target-mips: fix for incorrect multiplication with MULQ_S.PH
The change corrects sign-related issue with MULQ_S.PH. It also includes extension to the already existing test which will trigger the issue. Signed-off-by: Petar Jovanovic <petarj@mips.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 9c19eb1e205b29018f6f61c5f43db6abbe7dc0e5) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'target-mips/dsp_helper.c')
-rw-r--r--target-mips/dsp_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c
index 96cb0447e2..6781da8214 100644
--- a/target-mips/dsp_helper.c
+++ b/target-mips/dsp_helper.c
@@ -652,7 +652,7 @@ static inline int32_t mipsdsp_sat16_mul_q15_q15(uint16_t a, uint16_t b,
temp = 0x7FFF0000;
set_DSPControl_overflow_flag(1, 21, env);
} else {
- temp = ((uint32_t)a * (uint32_t)b);
+ temp = (int16_t)a * (int16_t)b;
temp = temp << 1;
}