diff options
| author | Petar Jovanovic <petarj@mips.com> | 2012-12-10 16:28:17 +0100 |
|---|---|---|
| committer | Aurelien Jarno <aurelien@aurel32.net> | 2013-01-01 11:11:38 +0100 |
| commit | b8abbbe8df5e04085f4b85fc4f7cf85efbcd492c (patch) | |
| tree | 597fbe25eec8e83317cf933f93106d938858aeab /tests/tcg/mips/mips32-dsp/extr_s_h.c | |
| parent | eec8972a5bc744eda695a86a984d746c240dff90 (diff) | |
| download | focaccia-qemu-b8abbbe8df5e04085f4b85fc4f7cf85efbcd492c.tar.gz focaccia-qemu-b8abbbe8df5e04085f4b85fc4f7cf85efbcd492c.zip | |
target-mips: Fix for helpers for EXTR_* instructions
The change removes some unnecessary and incorrect code for EXTR_S.H. Further, it corrects the mask for shift value in the EXTR_ instructions. It also extends the existing tests so they trigger the issues corrected with the change. Signed-off-by: Petar Jovanovic <petarj@mips.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tests/tcg/mips/mips32-dsp/extr_s_h.c')
| -rw-r--r-- | tests/tcg/mips/mips32-dsp/extr_s_h.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/tcg/mips/mips32-dsp/extr_s_h.c b/tests/tcg/mips/mips32-dsp/extr_s_h.c index b2129134c8..9bc2a63cc2 100644 --- a/tests/tcg/mips/mips32-dsp/extr_s_h.c +++ b/tests/tcg/mips/mips32-dsp/extr_s_h.c @@ -59,5 +59,28 @@ int main() assert(dsp == 0); assert(result == rt); + /* Clear dsp */ + dsp = 0; + __asm + ("wrdsp %0\n\t" + : + : "r"(dsp) + ); + + ach = 0x123; + acl = 0x87654321; + result = 0x1238; + __asm + ("mthi %2, $ac1\n\t" + "mtlo %3, $ac1\n\t" + "extr_s.h %0, $ac1, 28\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; } |