pub struct DenormalGuard { /* private fields */ }Expand description
RAII guard that enables denormal-flush mode on construction and restores the prior FPU control word on drop. See module docs.
Implementations§
Source§impl DenormalGuard
impl DenormalGuard
Sourcepub fn new() -> Self
pub fn new() -> Self
Set FTZ/DAZ (x86_64) or FZ (aarch64). On other targets this
is a no-op and the guard is a zero-sized stub.
Implemented via inline asm rather than the _mm_getcsr /
_mm_setcsr intrinsics: those are deprecated in current
stable Rust and the _MM_DENORMALS_ZERO_ON constant isn’t
always available alongside them. The two-instruction
stmxcsr / ldmxcsr pair is the same machine code the
intrinsics emit, just spelled differently in source.
Trait Implementations§
Source§impl Default for DenormalGuard
impl Default for DenormalGuard
Source§impl Drop for DenormalGuard
impl Drop for DenormalGuard
Auto Trait Implementations§
impl Freeze for DenormalGuard
impl RefUnwindSafe for DenormalGuard
impl Send for DenormalGuard
impl Sync for DenormalGuard
impl Unpin for DenormalGuard
impl UnsafeUnpin for DenormalGuard
impl UnwindSafe for DenormalGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more