diff options
author | Petar Jovanovic | 2013-03-15 18:56:19 +0100 |
---|---|---|
committer | Aurelien Jarno | 2013-03-17 01:06:34 +0100 |
commit | 8b758d0568a986d58c254b3c209691c82e0f82a1 (patch) | |
tree | 1577cab8cc5b6624914c4df9c4ee5a2a37dbf794 /tests/tcg/mips/mips32-dsp/extr_w.c | |
parent | Fix TAGS creation (diff) | |
download | qemu-8b758d0568a986d58c254b3c209691c82e0f82a1.tar.gz qemu-8b758d0568a986d58c254b3c209691c82e0f82a1.tar.xz qemu-8b758d0568a986d58c254b3c209691c82e0f82a1.zip |
target-mips: fix rndrashift_short_acc and code for EXTR_ instructions
Fix for rndrashift_short_acc to set correct value to higher 64 bits.
This change also corrects conditions when bit 23 of the DSPControl register
is set.
The existing test files have been extended with several examples that
trigger the issues. One bug/example in the test file for EXTR_RS_W has been
found and reported by Klaus Peichl.
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/extr_w.c')
-rw-r--r-- | tests/tcg/mips/mips32-dsp/extr_w.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/tcg/mips/mips32-dsp/extr_w.c b/tests/tcg/mips/mips32-dsp/extr_w.c index bd6b0b95c2..cf926146d5 100644 --- a/tests/tcg/mips/mips32-dsp/extr_w.c +++ b/tests/tcg/mips/mips32-dsp/extr_w.c @@ -67,5 +67,28 @@ int main() assert(dsp == 0); assert(result == rt); + /* Clear dspcontrol */ + dsp = 0; + __asm + ("wrdsp %0\n\t" + : + : "r"(dsp) + ); + + ach = 0xFFFFFFFF; + acl = 0xFFFFFFFF; + result = 0xFFFFFFFF; + __asm + ("mthi %2, $ac1\n\t" + "mtlo %3, $ac1\n\t" + "extr.w %0, $ac1, 0x1F\n\t" + "rddsp %1\n\t" + : "=r"(rt), "=r"(dsp) + : "r"(ach), "r"(acl) + ); + dsp = (dsp >> 23) & 0x01; + assert(dsp == 0); + assert(result == rt); + return 0; } |