diff options
author | RSDuck <rsduck@users.noreply.github.com> | 2020-07-08 23:08:25 +0200 |
---|---|---|
committer | RSDuck <rsduck@users.noreply.github.com> | 2020-07-08 23:08:25 +0200 |
commit | 3786660099e6517a9230ec6f76559b72aa1660fd (patch) | |
tree | e81c25213d2dad4af78492597f05692372de0b3f /src/ARMJIT_A64 | |
parent | 778623a8b7ded3a66fc838840ce85626f5feed05 (diff) |
misc JIT changes
Diffstat (limited to 'src/ARMJIT_A64')
-rw-r--r-- | src/ARMJIT_A64/ARMJIT_LoadStore.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/ARMJIT_A64/ARMJIT_LoadStore.cpp b/src/ARMJIT_A64/ARMJIT_LoadStore.cpp index c1b23a7..bdd9f43 100644 --- a/src/ARMJIT_A64/ARMJIT_LoadStore.cpp +++ b/src/ARMJIT_A64/ARMJIT_LoadStore.cpp @@ -474,19 +474,17 @@ s32 Compiler::Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc ANDI2R(W0, MapReg(rn), ~3); } - LoadStorePatch patch; if (compileFastPath) { ptrdiff_t fastPathStart = GetCodeOffset(); - ptrdiff_t firstLoadStoreOffset; - - bool firstLoadStore = true; + ptrdiff_t loadStoreOffsets[16]; MOVP2R(X1, Num == 0 ? ARMJIT_Memory::FastMem9Start : ARMJIT_Memory::FastMem7Start); ADD(X1, X1, X0); u32 offset = preinc ? 4 : 0; BitSet16::Iterator it = regs.begin(); + u32 i = 0; if (regsCount & 1) { @@ -499,11 +497,7 @@ s32 Compiler::Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc else if (store) LoadReg(reg, first); - if (firstLoadStore) - { - firstLoadStoreOffset = GetCodeOffset(); - firstLoadStore = false; - } + loadStoreOffsets[i++] = GetCodeOffset(); if (store) STR(INDEX_UNSIGNED, first, X1, offset); @@ -533,11 +527,7 @@ s32 Compiler::Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc else if (store) LoadReg(nextReg, second); - if (firstLoadStore) - { - firstLoadStoreOffset = GetCodeOffset(); - firstLoadStore = false; - } + loadStoreOffsets[i++] = GetCodeOffset(); if (store) STP(INDEX_SIGNED, first, second, X1, offset); @@ -552,12 +542,15 @@ s32 Compiler::Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc offset += 8; } + LoadStorePatch patch; patch.PatchSize = GetCodeOffset() - fastPathStart; - patch.PatchOffset = fastPathStart - firstLoadStoreOffset; SwapCodeRegion(); patch.PatchFunc = GetRXPtr(); - - LoadStorePatches[firstLoadStoreOffset] = patch; + for (i = 0; i < regsCount; i++) + { + patch.PatchOffset = fastPathStart - loadStoreOffsets[i]; + LoadStorePatches[loadStoreOffsets[i]] = patch; + } ABI_PushRegisters({30}); } |