Skip to content

Commit

Permalink
target-mips: Fix incorrect code and test for INSV
Browse files Browse the repository at this point in the history
Content of register rs should be shifted for pos before applying a mask.
This change contains both fix for the instruction and to the existing test.

Signed-off-by: Petar Jovanovic <petarj@mips.com>
Reviewed-by: Eric Johnson <ericj@mips.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
  • Loading branch information
petar-jovanovic authored and aurel32 committed Dec 6, 2012
1 parent 80625b9 commit 34f5606
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion target-mips/dsp_helper.c
Expand Up @@ -3152,7 +3152,7 @@ target_ulong helper_##name(CPUMIPSState *env, target_ulong rs, \
\
filter = ((int32_t)0x01 << size) - 1; \
filter = filter << pos; \
temprs = rs & filter; \
temprs = (rs << pos) & filter; \
temprt = rt & ~filter; \
temp = temprs | temprt; \
\
Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/mips/mips32-dsp/insv.c
Expand Up @@ -10,7 +10,7 @@ int main()
dsp = 0x305;
rt = 0x12345678;
rs = 0x87654321;
result = 0x12345338;
result = 0x12345438;
__asm
("wrdsp %2, 0x03\n\t"
"insv %0, %1\n\t"
Expand Down

0 comments on commit 34f5606

Please sign in to comment.