diff options
author | RSDuck <rsduck@users.noreply.github.com> | 2019-09-08 14:48:20 +0200 |
---|---|---|
committer | RSDuck <rsduck@users.noreply.github.com> | 2020-06-16 11:56:02 +0200 |
commit | 0e26aa4edeafa0dab57d6e5a1b77e1a80c6ae3c4 (patch) | |
tree | 55f9d6d3d9b74149127f827bdfb5a44896c79521 /src/ARMJIT_x64/ARMJIT_Branch.cpp | |
parent | 85680d6fe56a701d85f7312766764615fab2f012 (diff) |
load register only if needed
- do thumb bl long merge in the first step
- preparations for better branch jitting
Diffstat (limited to 'src/ARMJIT_x64/ARMJIT_Branch.cpp')
-rw-r--r-- | src/ARMJIT_x64/ARMJIT_Branch.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ARMJIT_x64/ARMJIT_Branch.cpp b/src/ARMJIT_x64/ARMJIT_Branch.cpp index c0a8f1f..cc7a3c4 100644 --- a/src/ARMJIT_x64/ARMJIT_Branch.cpp +++ b/src/ARMJIT_x64/ARMJIT_Branch.cpp @@ -271,15 +271,17 @@ void Compiler::T_Comp_BL_LONG_2() Comp_JumpTo(RSCRATCH); } -void Compiler::T_Comp_BL_Merged(FetchedInstr part1) +void Compiler::T_Comp_BL_Merged() { - assert(part1.Info.Kind == ARMInstrInfo::tk_BL_LONG_1); Comp_AddCycles_C(); - u32 target = (R15 - 2) + ((s32)((part1.Instr & 0x7FF) << 21) >> 9); - target += (CurInstr.Instr & 0x7FF) << 1; + R15 += 2; - if (Num == 1 || CurInstr.Instr & (1 << 12)) + u32 upperPart = CurInstr.Instr >> 16; + u32 target = (R15 - 2) + ((s32)((CurInstr.Instr & 0x7FF) << 21) >> 9); + target += (upperPart & 0x7FF) << 1; + + if (Num == 1 || upperPart & (1 << 12)) target |= 1; MOV(32, MapReg(14), Imm32((R15 - 2) | 1)); |