Permalink
Browse files

x64: Use context register to access saved_flags

  • Loading branch information...
hrydgard committed Jul 5, 2017
1 parent e6e96c0 commit c4db0a23114ae0d776511b1c95804d5cdcf98d15
Showing with 5 additions and 8 deletions.
  1. +3 −0 Core/MIPS/MIPS.h
  2. +2 −8 Core/MIPS/x86/Jit.cpp
View
@@ -203,6 +203,9 @@ class MIPSState
int llBit; // ll/sc
u32 temp; // can be used to save temporaries during calculations when we need more than R0 and R1
// Temporary used around delay slots and similar.
u64 saved_flags;
GMRng rng; // VFPU hardware random number generator. Probably not the right type.
// Debug stuff
View
@@ -48,8 +48,6 @@ namespace MIPSComp
{
using namespace Gen;
static u64 saved_flags;
const bool USE_JIT_MISSMAP = false;
static std::map<std::string, u32> notJitOps;
@@ -228,13 +226,13 @@ void Jit::SaveFlags() {
#if defined(_M_X64)
// On X64, the above misaligns the stack. However there might be a cheaper solution than this.
POP(64, R(EAX));
MOV(64, M(&saved_flags), R(EAX));
MOV(64, MDisp(X64JitConstants::CTXREG, offsetof(MIPSState, saved_flags)), R(EAX));
#endif
}
void Jit::LoadFlags() {
#if defined(_M_X64)
MOV(64, R(EAX), M(&saved_flags));
MOV(64, R(EAX), MDisp(X64JitConstants::CTXREG, offsetof(MIPSState, saved_flags)));
PUSH(64, R(EAX));
#endif
POPF();
@@ -429,10 +427,6 @@ void Jit::AddContinuedBlock(u32 dest)
}
bool Jit::DescribeCodePtr(const u8 *ptr, std::string &name) {
#if defined(_M_X64)
if (ptr == (const u8 *)&saved_flags)
name = "saved_flags";
#endif
if (ptr == applyRoundingMode)
name = "applyRoundingMode";
else if (ptr == updateRoundingMode)

0 comments on commit c4db0a2

Please sign in to comment.