diff options
author | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2013-05-18 03:53:41 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2013-05-19 15:10:51 +0200 |
commit | 0ba365f4a9752a82502e829a3e8cb5f03a1ffc0c (patch) | |
tree | 7ca5a7b2d4a046505f12ebd588a597a7ac8528a7 /tests/tcg | |
parent | 489ed4bbae309a6d897f6e037481c4c04f0737b5 (diff) | |
download | qemu-0ba365f4a9752a82502e829a3e8cb5f03a1ffc0c.zip qemu-0ba365f4a9752a82502e829a3e8cb5f03a1ffc0c.tar.gz qemu-0ba365f4a9752a82502e829a3e8cb5f03a1ffc0c.tar.bz2 |
target-mips: fix EXTPDP and setting up pos field in the DSPControl reg
This change makes sure that modifications of pos field in the DSPControl
register do not trash other bits in the register. This bug can be triggered
with the additional test case in mips32-dsp/extpdp.c in this commit.
In addition to this, this change corrects incorrect calculation of the mask
for EXTPDP.
Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tests/tcg')
-rw-r--r-- | tests/tcg/mips/mips32-dsp/extpdp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/tcg/mips/mips32-dsp/extpdp.c b/tests/tcg/mips/mips32-dsp/extpdp.c index 15ba082..79ee16e 100644 --- a/tests/tcg/mips/mips32-dsp/extpdp.c +++ b/tests/tcg/mips/mips32-dsp/extpdp.c @@ -42,5 +42,23 @@ int main() efi = (dsp >> 14) & 0x01; assert(efi == 1); + + ach = 0; + acl = 0; + dsp = 0; + result = 0; + + __asm + ("wrdsp %1\n\t" + "mthi %2, $ac1\n\t" + "mtlo %3, $ac1\n\t" + "extpdp %0, $ac1, 0x00\n\t" + "rddsp %1\n\t" + : "=r"(rt), "+r"(dsp) + : "r"(ach), "r"(acl) + ); + assert(dsp == 0x3F); + assert(result == rt); + return 0; } |