Merge pull request #18080 from unknownbrackets/x86jit-minor

x86jit: Correct jitbase range comparison
This commit is contained in:
Henrik Rydgård 2023-09-06 09:23:55 +02:00 committed by GitHub
commit f2512e0fdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,13 +58,13 @@ void X64JitBackend::GenerateFixedCode(MIPSState *mipsState) {
int jitbaseCtxDisp = 0;
// We pre-bake the MIPS_EMUHACK_OPCODE subtraction into our jitbase value.
intptr_t jitbase = (intptr_t)GetBasePtr() - MIPS_EMUHACK_OPCODE;
if ((jitbase < -0x80000000ULL || jitbase > 0x7FFFFFFFULL) && !Accessible((const u8 *)&mipsState->f[0], GetBasePtr())) {
if ((jitbase < -0x80000000LL || jitbase > 0x7FFFFFFFLL) && !Accessible((const u8 *)&mipsState->f[0], GetBasePtr())) {
jo.reserveR15ForAsm = true;
jitbaseInR15 = true;
} else {
jo.downcountInRegister = true;
jo.reserveR15ForAsm = true;
if (jitbase < -0x80000000ULL || jitbase > 0x7FFFFFFFULL) {
if (jitbase < -0x8000000ULL || jitbase > 0x7FFFFFFFLL) {
jitbaseCtxDisp = (int)(jitbase - (intptr_t)&mipsState->f[0]);
}
}