diff options
| author | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2013-07-29 04:06:12 +0200 |
|---|---|---|
| committer | Aurelien Jarno <aurelien@aurel32.net> | 2013-07-29 07:48:17 +0200 |
| commit | b6a9f4682e62c686995cc1a1fe2ef4a57a92020b (patch) | |
| tree | 6f11a2a886c713b4c84180404d3f468d3051c0a4 /tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c | |
| parent | f05d4d94d6bb0e240e6cfda65972fd86601f9f0d (diff) | |
| download | focaccia-qemu-b6a9f4682e62c686995cc1a1fe2ef4a57a92020b.tar.gz focaccia-qemu-b6a9f4682e62c686995cc1a1fe2ef4a57a92020b.zip | |
target-mips: fix mipsdsp_mul_q31_q31
Multiplication of two fractional word elements is not correct when sign extension/promotion is needed. This change fixes it by adding correct casts from unsigned to signed values. In addition, the tests (dpaq_sa_l_w.c and dpsq_sa_l_w.c) have been extended to trigger the current issue. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c')
| -rw-r--r-- | tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c b/tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c index b7b73fdb66..eda3b14e2b 100644 --- a/tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c +++ b/tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c @@ -9,8 +9,8 @@ int main() rs = 0xBC0123AD; rt = 0x01643721; - resulth = 0xfdf4cbe0; - resultl = 0xd138776b; + resulth = 0x00BD3A22; + resultl = 0xD138776B; resultdsp = 0x00; __asm ("mthi %0, $ac1\n\t" |