Permalink
Browse files

arm64jit: Free up W23 for static alloc.

We shouldn't always reserve W23 for this uncommon case.
  • Loading branch information...
unknownbrackets committed Dec 30, 2017
1 parent e7ac672 commit 89cbf36611daa0bebb5d2d75b2fba5b7a3139b6b
Showing with 5 additions and 4 deletions.
  1. +4 −2 Core/MIPS/ARM64/Arm64CompBranch.cpp
  2. +1 −2 Core/MIPS/ARM64/Arm64RegCache.h
@@ -536,7 +536,7 @@ void Arm64Jit::Comp_JumpReg(MIPSOpcode op)
delaySlotIsNice = false;
CONDITIONAL_NICE_DELAYSLOT;
ARM64Reg destReg = OTHERTEMPREG;
ARM64Reg destReg = INVALID_REG;
if (IsSyscall(delaySlotOp)) {
gpr.MapReg(rs);
MovToPC(gpr.R(rs)); // For syscall to be able to return.
@@ -574,7 +574,9 @@ void Arm64Jit::Comp_JumpReg(MIPSOpcode op)
destReg = gpr.R(rs); // Safe because FlushAll doesn't change any regs
FlushAll();
} else {
// Delay slot - this case is very rare, might be able to free up W24.
// Since we can't be in a delay slot, should be safe to steal FLAGTEMPREG for a temp reg.
// It will be saved, even if a function is called.
destReg = FLAGTEMPREG;
gpr.MapReg(rs);
MOV(destReg, gpr.R(rs));
if (andLink)
@@ -23,8 +23,7 @@
namespace Arm64JitConstants {
const Arm64Gen::ARM64Reg DOWNCOUNTREG = Arm64Gen::W23;
const Arm64Gen::ARM64Reg OTHERTEMPREG = Arm64Gen::W24;
const Arm64Gen::ARM64Reg DOWNCOUNTREG = Arm64Gen::W24;
const Arm64Gen::ARM64Reg FLAGTEMPREG = Arm64Gen::X25;
const Arm64Gen::ARM64Reg JITBASEREG = Arm64Gen::X26;
const Arm64Gen::ARM64Reg CTXREG = Arm64Gen::X27;

0 comments on commit 89cbf36

Please sign in to comment.