From 05f3f077047daeef64a6bac67af05fba305bc7a3 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 4 Dec 2017 17:52:38 +0000 Subject: [PATCH] emit_x64: Reduce mxscr operations in EmitGetFpscr and EmitSetFpscr --- src/backend_x64/emit_x64.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/backend_x64/emit_x64.cpp b/src/backend_x64/emit_x64.cpp index d40876e0..a070d6a3 100644 --- a/src/backend_x64/emit_x64.cpp +++ b/src/backend_x64/emit_x64.cpp @@ -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) {