aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg
diff options
context:
space:
mode:
authorPetar Jovanovic <petarj@mips.com>2013-02-06 18:05:25 +0100
committerAurelien Jarno <aurelien@aurel32.net>2013-02-23 22:20:44 +0100
commit9c19eb1e205b29018f6f61c5f43db6abbe7dc0e5 (patch)
tree06322cab1c08f85ad54636392baac20f99e20121 /tests/tcg
parentd2123a079d983677ec8333940aa4bec803d98cde (diff)
downloadqemu-9c19eb1e205b29018f6f61c5f43db6abbe7dc0e5.zip
qemu-9c19eb1e205b29018f6f61c5f43db6abbe7dc0e5.tar.gz
qemu-9c19eb1e205b29018f6f61c5f43db6abbe7dc0e5.tar.bz2
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>
Diffstat (limited to 'tests/tcg')
-rw-r--r--tests/tcg/mips/mips32-dspr2/mulq_s_ph.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/tcg/mips/mips32-dspr2/mulq_s_ph.c b/tests/tcg/mips/mips32-dspr2/mulq_s_ph.c
index d0f7674..00e0155 100644
--- a/tests/tcg/mips/mips32-dspr2/mulq_s_ph.c
+++ b/tests/tcg/mips/mips32-dspr2/mulq_s_ph.c
@@ -6,6 +6,21 @@ int main()
int rd, rs, rt, dsp;
int result, resultdsp;
+ rs = 0x80000000;
+ rt = 0x0ffc0000;
+ result = 0xF0040000;
+ resultdsp = 0;
+
+ __asm
+ ("mulq_s.ph %0, %2, %3\n\t"
+ "rddsp %1\n\t"
+ : "=r"(rd), "=r"(dsp)
+ : "r"(rs), "r"(rt)
+ );
+ dsp = (dsp >> 21) & 0x01;
+ assert(rd == result);
+ assert(dsp == resultdsp);
+
rs = 0x80001234;
rt = 0x80004321;
result = 0x7FFF098B;