dyncom: Correct SXTAB16 and SXTB16

This commit is contained in:
MerryMage 2017-02-18 20:12:39 +00:00
parent 73d1cf36c3
commit c7f32f9466

View file

@ -3578,13 +3578,13 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
if (inst_cream->Rn == 15) { if (inst_cream->Rn == 15) {
u32 lo = (u32)(s8)rm_val; u32 lo = (u32)(s8)rm_val;
u32 hi = (u32)(s8)(rm_val >> 16); u32 hi = (u32)(s8)(rm_val >> 16);
RD = (lo | (hi << 16)); RD = (lo & 0xFFFF) | (hi << 16);
} }
// SXTAB16 // SXTAB16
else { else {
u32 lo = (rn_val & 0xFFFF) + (u32)(s8)(rm_val & 0xFF); u32 lo = rn_val + (u32)(s8)(rm_val & 0xFF);
u32 hi = ((rn_val >> 16) & 0xFFFF) + (u32)(s8)((rm_val >> 16) & 0xFF); u32 hi = (rn_val >> 16) + (u32)(s8)((rm_val >> 16) & 0xFF);
RD = (lo | (hi << 16)); RD = (lo & 0xFFFF) | (hi << 16);
} }
} }