mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 02:33:43 +01:00
Shave some more instructions
This commit is contained in:
1 parent
2e6063d084
commit
37be2600be
2 files changed
+21
-12
No files matched your search
@@ -127,10 +127,7 @@ void Jit::GenerateFixedCode()
|
||||
|
||||
LDR(R0, R10, offsetof(MIPSState, pc));
|
||||
BIC(R0, R0, Operand2(0xC0, 4)); // &= 0x3FFFFFFF
|
||||
ADD(R0, R0, R11); // TODO: Optimize (can merge with next instr)
|
||||
LDR(R0, R0);
|
||||
// This could replace the above two instructions if the emitter wasn't bugged:
|
||||
// LDR(R0, R11, Operand2(R0));
|
||||
LDR(R0, R11, R0, true, true);
|
||||
AND(R1, R0, Operand2(0xFC, 4)); // rotation is to the right, in 2-bit increments.
|
||||
BIC(R0, R0, Operand2(0xFC, 4));
|
||||
CMP(R1, Operand2(MIPS_EMUHACK_OPCODE >> 24, 4));
|
||||
|
||||
@@ -59,17 +59,23 @@ namespace MIPSComp
|
||||
if (TryMakeOperand2(offset, op2)) {
|
||||
ADD(R0, gpr.R(rs), op2);
|
||||
} else {
|
||||
ARMABI_MOVI2R(R0, (u32)offset);
|
||||
ADD(R0, gpr.R(rs), R0);
|
||||
// Try to avoid using MOVT
|
||||
if (offset < 0) {
|
||||
ARMABI_MOVI2R(R0, (u32)(-offset));
|
||||
SUB(R0, gpr.R(rs), R0);
|
||||
} else {
|
||||
ARMABI_MOVI2R(R0, (u32)offset);
|
||||
ADD(R0, gpr.R(rs), R0);
|
||||
}
|
||||
}
|
||||
BIC(R0, R0, Operand2(0xC0, 4)); // &= 0x3FFFFFFF
|
||||
} else {
|
||||
BIC(R0, gpr.R(rs), Operand2(0xC0, 4)); // &= 0x3FFFFFFF
|
||||
}
|
||||
ADD(R0, R0, R11); // TODO: Merge with next instruction
|
||||
if (o == 35) {
|
||||
LDR(gpr.R(rt), R0);
|
||||
LDR(gpr.R(rt), R11, R0, true, true);
|
||||
} else if (o == 36) {
|
||||
ADD(R0, R0, R11); // TODO: Merge with next instruction
|
||||
LDRB(gpr.R(rt), R0);
|
||||
}
|
||||
} else {
|
||||
@@ -91,17 +97,23 @@ namespace MIPSComp
|
||||
if (TryMakeOperand2(offset, op2)) {
|
||||
ADD(R0, gpr.R(rs), op2);
|
||||
} else {
|
||||
ARMABI_MOVI2R(R0, (u32)offset);
|
||||
ADD(R0, gpr.R(rs), R0);
|
||||
// Try to avoid using MOVT
|
||||
if (offset < 0) {
|
||||
ARMABI_MOVI2R(R0, (u32)(-offset));
|
||||
SUB(R0, gpr.R(rs), R0);
|
||||
} else {
|
||||
ARMABI_MOVI2R(R0, (u32)offset);
|
||||
ADD(R0, gpr.R(rs), R0);
|
||||
}
|
||||
}
|
||||
BIC(R0, R0, Operand2(0xC0, 4)); // &= 0x3FFFFFFF
|
||||
} else {
|
||||
BIC(R0, gpr.R(rs), Operand2(0xC0, 4)); // &= 0x3FFFFFFF
|
||||
}
|
||||
ADD(R0, R0, R11);
|
||||
if (o == 43) {
|
||||
STR(R0, gpr.R(rt));
|
||||
STR(R0, gpr.R(rt), R11, true, true);
|
||||
} else if (o == 40) {
|
||||
ADD(R0, R0, R11);
|
||||
STRB(R0, gpr.R(rt));
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user