aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2020-02-07 00:08:29 +0100
committerRSDuck <rsduck@users.noreply.github.com>2020-06-16 11:57:54 +0200
commitd2acceb36754df349cf5d483155f71332a50000c (patch)
treea173a293bff10867924b815cb8d19c34f087d333 /src
parent272542972775368cec990561e419e84e34e09fe8 (diff)
fixup for aarch64 JIT
Diffstat (limited to 'src')
-rw-r--r--src/ARMJIT_A64/ARMJIT_Compiler.cpp1
-rw-r--r--src/ARMJIT_RegisterCache.h10
2 files changed, 8 insertions, 3 deletions
diff --git a/src/ARMJIT_A64/ARMJIT_Compiler.cpp b/src/ARMJIT_A64/ARMJIT_Compiler.cpp
index d61cc9c..2033307 100644
--- a/src/ARMJIT_A64/ARMJIT_Compiler.cpp
+++ b/src/ARMJIT_A64/ARMJIT_Compiler.cpp
@@ -83,7 +83,6 @@ Compiler::Compiler()
JitMemUseableSize = JitMemSize;
Reset();
#else
- #else
u64 pageSize = sysconf(_SC_PAGE_SIZE);
u8* pageAligned = (u8*)(((u64)JitMem & ~(pageSize - 1)) + pageSize);
u64 alignedSize = (((u64)JitMem + sizeof(JitMem)) & ~(pageSize - 1)) - (u64)pageAligned;
diff --git a/src/ARMJIT_RegisterCache.h b/src/ARMJIT_RegisterCache.h
index b894657..8460825 100644
--- a/src/ARMJIT_RegisterCache.h
+++ b/src/ARMJIT_RegisterCache.h
@@ -18,11 +18,15 @@ public:
RegisterCache()
{}
- RegisterCache(T* compiler, FetchedInstr instrs[], int instrsCount)
+ RegisterCache(T* compiler, FetchedInstr instrs[], int instrsCount, bool pcAllocatableAsSrc = false)
: Compiler(compiler), Instrs(instrs), InstrsCount(instrsCount)
{
for (int i = 0; i < 16; i++)
Mapping[i] = (Reg)-1;
+
+ PCAllocatableAsSrc = ~(pcAllocatableAsSrc
+ ? 0
+ : (1 << 15));
}
void UnloadRegister(int reg)
@@ -120,7 +124,7 @@ public:
for (int reg : neverNeededAgain)
UnloadRegister(reg);
- u16 necessaryRegs = ((instr.Info.SrcRegs & ~(1 << 15)) | instr.Info.DstRegs) & ~instr.Info.NotStrictlyNeeded;
+ u16 necessaryRegs = ((instr.Info.SrcRegs & PCAllocatableAsSrc) | instr.Info.DstRegs) & ~instr.Info.NotStrictlyNeeded;
u16 writeRegs = instr.Info.DstRegs & ~instr.Info.NotStrictlyNeeded;
BitSet16 needToBeLoaded(necessaryRegs & ~LoadedRegs);
if (needToBeLoaded != BitSet16(0))
@@ -184,6 +188,8 @@ public:
u16 LoadedRegs = 0;
u16 DirtyRegs = 0;
+ u16 PCAllocatableAsSrc = 0;
+
T* Compiler;
FetchedInstr* Instrs;