aboutsummaryrefslogtreecommitdiffstats
path: root/core/fpu_ctrl.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-18 17:41:07 -0800
committerChris Robinson <[email protected]>2023-12-18 17:41:07 -0800
commitcce4c81282ee5434d707458a9e061a6fcd1189d5 (patch)
tree1e424a3ee6d81ff58a37be398ae53406a5e259c8 /core/fpu_ctrl.cpp
parent708a90ef8ef7ee00991556298073c50dfa6e72a1 (diff)
Fix and cleanup some more warnings
Diffstat (limited to 'core/fpu_ctrl.cpp')
-rw-r--r--core/fpu_ctrl.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/core/fpu_ctrl.cpp b/core/fpu_ctrl.cpp
index 435855ad..28e60c04 100644
--- a/core/fpu_ctrl.cpp
+++ b/core/fpu_ctrl.cpp
@@ -64,29 +64,24 @@ void reset_fpu(unsigned int state [[maybe_unused]])
} // namespace
-void FPUCtl::enter() noexcept
+unsigned int FPUCtl::Set() noexcept
{
- if(this->in_mode) return;
-
+ unsigned int state{};
#if defined(HAVE_SSE_INTRINSICS)
- disable_denormals(&this->sse_state);
+ disable_denormals(&state);
#elif defined(HAVE_SSE)
if((CPUCapFlags&CPU_CAP_SSE))
- disable_denormals(&this->sse_state);
+ disable_denormals(&state);
#endif
-
- this->in_mode = true;
+ return state;
}
-void FPUCtl::leave() noexcept
+void FPUCtl::Reset(unsigned int state [[maybe_unused]]) noexcept
{
- if(!this->in_mode) return;
-
#if defined(HAVE_SSE_INTRINSICS)
- reset_fpu(this->sse_state);
+ reset_fpu(state);
#elif defined(HAVE_SSE)
if((CPUCapFlags&CPU_CAP_SSE))
- reset_fpu(this->sse_state);
+ reset_fpu(state);
#endif
- this->in_mode = false;
}