From cce4c81282ee5434d707458a9e061a6fcd1189d5 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 18 Dec 2023 17:41:07 -0800 Subject: Fix and cleanup some more warnings --- core/fpu_ctrl.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'core/fpu_ctrl.cpp') 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; } -- cgit v1.2.3