From 9c19eb1e205b29018f6f61c5f43db6abbe7dc0e5 Mon Sep 17 00:00:00 2001 From: Petar Jovanovic Date: Wed, 6 Feb 2013 18:05:25 +0100 Subject: 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 Signed-off-by: Aurelien Jarno --- target-mips/dsp_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target-mips') 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; } -- cgit v1.2.3