aboutsummaryrefslogtreecommitdiff
path: root/src/ARMJIT_x64/ARMJIT_ALU.cpp
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2019-10-03 01:10:59 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-06-16 11:56:36 +0200
commit40b88ab05aeb7e5c5216f29f4004fb5797db04b5 (patch)
tree32bfaf107c25fb64320281f2e379e851b48c2245 /src/ARMJIT_x64/ARMJIT_ALU.cpp
parent0e26aa4edeafa0dab57d6e5a1b77e1a80c6ae3c4 (diff)
new block cache and much more...
- more reliable code invalidation detection - blocks aren't stopped at any branch, but are being followed if possible to get larger blocks - idle loop recognition - optimised literal loads, load/store cycle counting and loads/stores from constant addresses
Diffstat (limited to 'src/ARMJIT_x64/ARMJIT_ALU.cpp')
-rw-r--r--src/ARMJIT_x64/ARMJIT_ALU.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ARMJIT_x64/ARMJIT_ALU.cpp b/src/ARMJIT_x64/ARMJIT_ALU.cpp
index f868ddf..14c223b 100644
--- a/src/ARMJIT_x64/ARMJIT_ALU.cpp
+++ b/src/ARMJIT_x64/ARMJIT_ALU.cpp
@@ -213,7 +213,13 @@ void Compiler::A_Comp_MovOp()
MOV(32, rd, op2);
if (((CurInstr.Instr >> 21) & 0xF) == 0xF)
+ {
NOT(32, rd);
+ if (op2.IsImm() && CurInstr.Cond() == 0xE)
+ RegCache.PutLiteral(CurInstr.A_Reg(12), ~op2.Imm32());
+ }
+ else if (op2.IsImm() && CurInstr.Cond() == 0xE)
+ RegCache.PutLiteral(CurInstr.A_Reg(12), op2.Imm32());
if (S)
{
@@ -564,7 +570,13 @@ void Compiler::T_Comp_AddSub_()
Comp_AddCycles_C();
- if (op & 1)
+ // special case for thumb mov being alias to add rd, rn, #0
+ if (CurInstr.SetFlags == 0 && rn.IsImm() && rn.Imm32() == 0)
+ {
+ if (rd != rs)
+ MOV(32, rd, rs);
+ }
+ else if (op & 1)
Comp_ArithTriOp(&Compiler::SUB, rd, rs, rn, false, opSetsFlags|opInvertCarry|opRetriveCV);
else
Comp_ArithTriOp(&Compiler::ADD, rd, rs, rn, false, opSetsFlags|opSymmetric|opRetriveCV);
@@ -614,7 +626,7 @@ void Compiler::T_Comp_ALU()
u32 op = (CurInstr.Instr >> 6) & 0xF;
if ((op >= 0x2 && op < 0x4) || op == 0x7)
- Comp_AddCycles_CI(1);
+ Comp_AddCycles_CI(1); // shift by reg
else
Comp_AddCycles_C();