提交 e6e2784c 编写于 作者: Y Yongbok Kim

target-mips: fix bad shifts in {dextp|dextpdp}

Fixed issues in the MIPSDSP64 instructions dextp and dextpdp.
Shifting can go out of 32 bit range.

https://bugs.launchpad.net/qemu/+bug/1631625Reported-by: NThomas Huth <thuth@redhat.com>
Reported-by: NJia Liu <proljc@gmail.com>
Signed-off-by: NYongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: NThomas Huth <thuth@redhat.com>
上级 b5a587b6
......@@ -3477,7 +3477,7 @@ target_ulong helper_dextp(target_ulong ac, target_ulong size, CPUMIPSState *env)
if (sub >= -1) {
temp = (tempB << (64 - len)) | (tempA >> len);
temp = temp & ((0x01 << (size + 1)) - 1);
temp = temp & ((1ULL << (size + 1)) - 1);
set_DSPControl_efi(0, env);
} else {
set_DSPControl_efi(1, env);
......@@ -3506,7 +3506,7 @@ target_ulong helper_dextpdp(target_ulong ac, target_ulong size,
if (sub >= -1) {
temp = (tempB << (64 - len)) | (tempA >> len);
temp = temp & ((0x01 << (size + 1)) - 1);
temp = temp & ((1ULL << (size + 1)) - 1);
set_DSPControl_pos(sub, env);
set_DSPControl_efi(0, env);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册