Access FPU temps through CTXREG

This commit is contained in:
Henrik Rydgård 2017-07-05 15:38:55 +02:00
parent 752254d404
commit 0645677fea
3 changed files with 4 additions and 6 deletions

View File

@ -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 File

@ -359,8 +359,6 @@ private:
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;}

View File

@ -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]);
}
}