diff options
author | Sven Göthel <[email protected]> | 2024-01-05 13:52:12 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-05 13:52:12 +0100 |
commit | ec98cdacc85ff0202852472c7756586437912f22 (patch) | |
tree | 42414746a27ab35cb8cdbc95af521d74821e57f4 /core/fpu_ctrl.cpp | |
parent | fd5269bec9a5fe4815974b1786a037e6a247bfd2 (diff) | |
parent | b82cd2e60edb8fbe5fdd3567105ae76a016a554c (diff) |
Diffstat (limited to 'core/fpu_ctrl.cpp')
-rw-r--r-- | core/fpu_ctrl.cpp | 21 |
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; } |