diff options
author | RSDuck <RSDuck@users.noreply.github.com> | 2020-07-04 18:58:00 +0200 |
---|---|---|
committer | RSDuck <RSDuck@users.noreply.github.com> | 2020-07-04 18:58:00 +0200 |
commit | 778623a8b7ded3a66fc838840ce85626f5feed05 (patch) | |
tree | 1fc317f4aa173cc9933c74163756103c2e67e0bb /src/ARMJIT_x64 | |
parent | 62c6e2f703d88660e0ca9bda78032c5bd6b63a78 (diff) |
make linux work and fix a few bugs
Diffstat (limited to 'src/ARMJIT_x64')
-rw-r--r-- | src/ARMJIT_x64/ARMJIT_LoadStore.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/ARMJIT_x64/ARMJIT_LoadStore.cpp b/src/ARMJIT_x64/ARMJIT_LoadStore.cpp index 2da113b..ff15729 100644 --- a/src/ARMJIT_x64/ARMJIT_LoadStore.cpp +++ b/src/ARMJIT_x64/ARMJIT_LoadStore.cpp @@ -379,19 +379,16 @@ s32 Compiler::Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc AND(32, R(RSCRATCH4), Imm8(~3)); u8* fastPathStart = GetWritableCodePtr(); - u8* firstLoadStoreAddr; - - bool firstLoadStore = true; + u8* loadStoreAddr[16]; MOV(64, R(RSCRATCH2), ImmPtr(Num == 0 ? ARMJIT_Memory::FastMem9Start : ARMJIT_Memory::FastMem7Start)); ADD(64, R(RSCRATCH2), R(RSCRATCH4)); - MOV(32, R(RSCRATCH3), R(RSCRATCH4)); u32 offset = 0; + int i = 0; for (int reg : regs) { - if (firstLoadStore) - firstLoadStoreAddr = GetWritableCodePtr(); + loadStoreAddr[i] = GetWritableCodePtr(); OpArg mem = MDisp(RSCRATCH2, offset); if (store) @@ -403,8 +400,7 @@ s32 Compiler::Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc else { LoadReg(reg, RSCRATCH); - if (firstLoadStore) - firstLoadStoreAddr = GetWritableCodePtr(); + loadStoreAddr[i] = GetWritableCodePtr(); MOV(32, mem, R(RSCRATCH)); } } @@ -421,17 +417,19 @@ s32 Compiler::Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc } } offset += 4; - - firstLoadStore = false; + i++; } LoadStorePatch patch; patch.Size = GetWritableCodePtr() - fastPathStart; - patch.Offset = fastPathStart - firstLoadStoreAddr; SwitchToFarCode(); patch.PatchFunc = GetWritableCodePtr(); - LoadStorePatches[firstLoadStoreAddr] = patch; + for (i = 0; i < regsCount; i++) + { + patch.Offset = fastPathStart - loadStoreAddr[i]; + LoadStorePatches[loadStoreAddr[i]] = patch; + } } if (!store) |