diff options
author | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2013-05-13 15:20:26 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2013-05-17 19:29:40 +0200 |
commit | 489ed4bbae309a6d897f6e037481c4c04f0737b5 (patch) | |
tree | 11a8633a968a3a51c2611b64b1e99a703d74d6ca /tests/tcg | |
parent | 91b96cdc5befe56e7d9651189d0cbf06fc3f3902 (diff) | |
download | qemu-489ed4bbae309a6d897f6e037481c4c04f0737b5.zip qemu-489ed4bbae309a6d897f6e037481c4c04f0737b5.tar.gz qemu-489ed4bbae309a6d897f6e037481c4c04f0737b5.tar.bz2 |
target-mips: fix incorrect behaviour for EXTP
The mask for EXTP instruction when size=31 has not been correctly
calculated.
The test (mips32-dsp/extp.c) has been extended to include the case that
triggers the issue.
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/extp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/tcg/mips/mips32-dsp/extp.c b/tests/tcg/mips/mips32-dsp/extp.c index 21a67af..b18bdb3 100644 --- a/tests/tcg/mips/mips32-dsp/extp.c +++ b/tests/tcg/mips/mips32-dsp/extp.c @@ -40,5 +40,23 @@ int main() dsp = (dsp >> 14) & 0x01; assert(dsp == 1); + ach = 0; + acl = 0x80000001; + dsp = 0x1F; + result = 0x80000001; + + __asm + ("wrdsp %1\n\t" + "mthi %2, $ac2\n\t" + "mtlo %3, $ac2\n\t" + "extp %0, $ac2, 0x1F\n\t" + "rddsp %1\n\t" + : "=r"(rt), "+r"(dsp) + : "r"(ach), "r"(acl) + ); + dsp = (dsp >> 14) & 0x01; + assert(dsp == 0); + assert(result == rt); + return 0; } |