diff options
| author | StapleButter <thetotalworm@gmail.com> | 2017-12-29 03:17:32 +0100 | 
|---|---|---|
| committer | StapleButter <thetotalworm@gmail.com> | 2017-12-29 03:17:32 +0100 | 
| commit | d50e7e4686c672e80aab50532fa9c25c9bbf226b (patch) | |
| tree | 95748e71199506a58f717a45ceec680accbc60c5 | |
| parent | 9336e15197694eeb823da785668c5d892c318db4 (diff) | |
fix SMULWx/SMLAWx. fixes #78, finally
| -rw-r--r-- | src/ARMInterpreter_ALU.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ARMInterpreter_ALU.cpp b/src/ARMInterpreter_ALU.cpp index 7ff8255..4f76b8b 100644 --- a/src/ARMInterpreter_ALU.cpp +++ b/src/ARMInterpreter_ALU.cpp @@ -895,7 +895,7 @@ void A_SMLAWy(ARM* cpu)      if (cpu->CurInstr & (1<<6)) rs >>= 16;      else                        rs &= 0xFFFF; -    u32 res_mul = ((s32)rm * (s16)rs) >> 16; // CHECKME +    u32 res_mul = ((s64)(s32)rm * (s16)rs) >> 16;      u32 res = res_mul + rn;      cpu->R[(cpu->CurInstr >> 16) & 0xF] = res; @@ -930,7 +930,7 @@ void A_SMULWy(ARM* cpu)      if (cpu->CurInstr & (1<<6)) rs >>= 16;      else                        rs &= 0xFFFF; -    u32 res = ((s32)rm * (s16)rs) >> 16; // CHECKME +    u32 res = ((s64)(s32)rm * (s16)rs) >> 16;      cpu->R[(cpu->CurInstr >> 16) & 0xF] = res;  }  |