3 releases
0.1.2 | Jul 14, 2023 |
---|---|
0.1.1 | Jun 11, 2023 |
0.1.0 | Jun 11, 2023 |
#422 in Audio
1,293 downloads per month
Used in 3 crates
(via web-audio-api)
7KB
109 lines
no_denormals
Temporarily turn off floating point denormals.
Internally, this uses a RAII-style guard to manage the state of certain processor flags.
On x86
and x86_64
, this sets the flush-to-zero and denormals-are-zero flags in the MXCSR register.
On aarch64
this sets the flush-to-zero flag in the FPCR register.
In all cases, the register will be reset to its initial state when the guard is dropped.
Usage
use no_denormals::no_denormals;
no_denormals(|| {
// your DSP code here.
});
lib.rs
:
Temporarily turn off floating point denormals.
Internally, this uses a RAII-style guard to manage the state of certain processor flags. On x86 and x86_64, this sets the flush-to-zero and denormals-are-zero flags in the MXCSR register. On aarch64 this sets the flush-to-zero flag in the FPCR register. In all cases, the register will be reset to its initial state when the guard is dropped.
Usage
use no_denormals::no_denormals;
no_denormals(|| {
// your DSP code here.
});