diff --git a/Common/ArmEmitter.cpp b/Common/ArmEmitter.cpp index 301224dc5c..1f58aefd02 100644 --- a/Common/ArmEmitter.cpp +++ b/Common/ArmEmitter.cpp @@ -610,9 +610,13 @@ void ARMXEmitter::STRH (ARMReg dest, ARMReg src, Operand2 op) Write32(condition | (0x04 << 20) | (src << 16) | (dest << 12) | ((Imm >> 4) << 8) | (0xB << 4) | (Imm & 0x0F)); } void ARMXEmitter::STRB (ARMReg dest, ARMReg src, Operand2 op) { WriteStoreOp(0x44, dest, src, op);} -void ARMXEmitter::STR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add, int shift, ShiftType type) +void ARMXEmitter::STR (ARMReg dest, ARMReg base, Operand2 op2, bool Index, bool Add) { - Write32(condition | (0x60 << 20) | (Index << 24) | (Add << 23) | (dest << 16) | (base << 12) | (shift << 7) | (type << 5) | offset); + Write32(condition | (0x60 << 20) | (Index << 24) | (Add << 23) | (dest << 16) | (base << 12) | op2.IMMSR()); +} +void ARMXEmitter::STR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add) +{ + Write32(condition | (0x60 << 20) | (Index << 24) | (Add << 23) | (dest << 16) | (base << 12) | offset); } void ARMXEmitter::STRH (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add) { @@ -658,9 +662,13 @@ void ARMXEmitter::LDRSB(ARMReg dest, ARMReg src, Operand2 op) Write32(condition | (0x05 << 20) | (src << 16) | (dest << 12) | ((Imm >> 4) << 8) | (0xD << 4) | (Imm & 0x0F)); } -void ARMXEmitter::LDR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add, int shift, ShiftType type) +void ARMXEmitter::LDR (ARMReg dest, ARMReg base, Operand2 op2, bool Index, bool Add) { - Write32(condition | (0x61 << 20) | (Index << 24) | (Add << 23) | (base << 16) | (dest << 12) | (shift << 7) | (type << 5) | offset); + Write32(condition | (0x61 << 20) | (Index << 24) | (Add << 23) | (base << 16) | (dest << 12) | op2.IMMSR()); +} +void ARMXEmitter::LDR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add) +{ + Write32(condition | (0x61 << 20) | (Index << 24) | (Add << 23) | (base << 16) | (dest << 12) | offset); } void ARMXEmitter::LDRH (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add) { diff --git a/Common/ArmEmitter.h b/Common/ArmEmitter.h index 4f5e2574a4..feab20eb86 100644 --- a/Common/ArmEmitter.h +++ b/Common/ArmEmitter.h @@ -501,7 +501,8 @@ public: void LDRB (ARMReg dest, ARMReg src, Operand2 op2 = 0); void LDRSB(ARMReg dest, ARMReg src, Operand2 op2 = 0); // Offset adds to the base register in LDR - void LDR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add, int shift = 0, ShiftType type = ST_LSL); + void LDR (ARMReg dest, ARMReg base, Operand2 op2, bool Index, bool Add); + void LDR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add); void LDRH (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add); void LDRSH(ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add); void LDRB (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add); @@ -512,7 +513,8 @@ public: void STRH (ARMReg dest, ARMReg src, Operand2 op2 = 0); void STRB (ARMReg dest, ARMReg src, Operand2 op2 = 0); // Offset adds on to the destination register in STR - void STR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add, int shift = 0, ShiftType type = ST_LSL); + void STR (ARMReg dest, ARMReg base, Operand2 op2, bool Index, bool Add); + void STR (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add); void STRH (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add); void STRB (ARMReg dest, ARMReg base, ARMReg offset, bool Index, bool Add); diff --git a/Core/MIPS/ARM/ArmCompLoadStore.cpp b/Core/MIPS/ARM/ArmCompLoadStore.cpp index 2f7e92c84d..37e153fcc1 100644 --- a/Core/MIPS/ARM/ArmCompLoadStore.cpp +++ b/Core/MIPS/ARM/ArmCompLoadStore.cpp @@ -142,7 +142,6 @@ namespace MIPSComp case 46: //swr if (g_Config.bFastMemory) { int shift = 0; - if (o == 38) DISABLE; // Crashes, so disable for now. if (shifter) { shift = (offset & 3) << 3; @@ -163,14 +162,13 @@ namespace MIPSComp // Load case 34: AND(gpr.R(rt), gpr.R(rt), 0x00ffffff >> shift); - LDR(R0, R11, R0, true, true, 24 - shift, ST_LSL); - ORR(gpr.R(rt), gpr.R(rt), R0); + LDR(R0, R11, R0, true, true); + ORR(gpr.R(rt), gpr.R(rt), Operand2(24 - shift, ST_LSL, R0)); break; case 38: AND(gpr.R(rt), gpr.R(rt), 0xffffff00 << (24 - shift)); - // Current this shifted LDR crashes, so it has been disabled - LDR(R0, R11, R0, true, true, shift, ST_LSR); - ORR(gpr.R(rt), gpr.R(rt), R0); + LDR(R0, R11, R0, true, true); + ORR(gpr.R(rt), gpr.R(rt), Operand2(shift, ST_LSR, R0)); break; case 35: LDR (gpr.R(rt), R11, R0, true, true); break; case 37: LDRH (gpr.R(rt), R11, R0, true, true); break;