emit_x64: Reduce mxscr operations in EmitGetFpscr and EmitSetFpscr

This commit is contained in:
MerryMage 2017-12-04 17:52:38 +00:00
parent 0af1e7723d
commit 05f3f07704

View file

@ -449,9 +449,8 @@ void EmitX64::EmitGetFpscr(RegAlloc& reg_alloc, IR::Block&, IR::Inst* inst) {
reg_alloc.HostCall(inst);
code->mov(code->ABI_PARAM1, code->r15);
code->SwitchMxcsrOnExit();
code->stmxcsr(code->dword[code->r15 + offsetof(JitState, guest_MXCSR)]);
code->CallFunction(&GetFpscrImpl);
code->SwitchMxcsrOnEntry();
}
static void SetFpscrImpl(u32 value, JitState* jit_state) {
@ -463,9 +462,8 @@ void EmitX64::EmitSetFpscr(RegAlloc& reg_alloc, IR::Block&, IR::Inst* inst) {
reg_alloc.HostCall(nullptr, args[0]);
code->mov(code->ABI_PARAM2, code->r15);
code->SwitchMxcsrOnExit();
code->CallFunction(&SetFpscrImpl);
code->SwitchMxcsrOnEntry();
code->ldmxcsr(code->dword[code->r15 + offsetof(JitState, guest_MXCSR)]);
}
void EmitX64::EmitGetFpscrNZCV(RegAlloc& reg_alloc, IR::Block&, IR::Inst* inst) {