Permalink
Browse files

Access FPU temps through CTXREG

  • Loading branch information...
hrydgard committed Jul 5, 2017
1 parent 752254d commit 0645677fea2efa3ede2dfe18df565ffeaf86e241
Showing with 4 additions and 6 deletions.
  1. +1 −1 Common/x64Emitter.cpp
  2. +0 −2 Common/x64Emitter.h
  3. +3 −3 Core/MIPS/x86/RegCacheFPU.cpp
View
@@ -269,7 +269,7 @@ void OpArg::WriteRest(XEmitter *emit, int extraBytes, X64Reg _operandReg,
{
mod = 0;
}
else if (ioff<-128 || ioff>127)
else if (ioff < -128 || ioff > 127)
{
mod = 2; //32-bit displacement
}
View
@@ -359,8 +359,6 @@ class XEmitter
void WriteFloatLoadStore(int bits, FloatOp op, FloatOp op_80b, OpArg arg);
void WriteNormalOp(XEmitter *emit, int bits, NormalOp op, const OpArg &a1, const OpArg &a2);
void ABI_CalculateFrameSize(u32 mask, size_t rsp_alignment, size_t needed_frame_size, size_t* shadowp, size_t* subtractionp, size_t* xmm_offsetp);
protected:
inline void Write8(u8 value) {*code++ = value;}
inline void Write16(u16 value) {*(u16*)code = (value); code += 2;}
@@ -895,10 +895,10 @@ OpArg FPURegCache::GetDefaultLocation(int reg) const {
return MDisp(CTXREG, reg * 4);
} else if (reg < 32 + 128) {
return M(&mips->v[voffset[reg - 32]]);
// This should work, but doesn't seem to. Maybe used from somewhere where CTXREG is not yet set properly.
// return MDisp(CTXREG, offsetof(MIPSState, v[0]) - offsetof(MIPSState, f[0]) + voffset[reg - 32] * sizeof(float));
// This should work, but doesn't seem to (crashes Crisis Core). Seems a bad instruction is generated somehow...
// return MIPSSTATE_VAR(v[voffset[reg - 32]]);
} else {
return M(&mips->tempValues[reg - 32 - 128]);
return MIPSSTATE_VAR(tempValues[reg - 32 - 128]);
}
}

0 comments on commit 0645677

Please sign in to comment.