Module denormal

Source
Expand description

Denormal (subnormal) float handling utilities.

Denormalized floating-point numbers are very small values that can cause significant CPU slowdowns (10-100x) on x86 processors due to microcode fallback handling. This module provides utilities to flush these values to zero, preventing performance degradation in audio processing.

When the ftz-daz feature is enabled, this module also provides CPU-level FTZ (Flush-To-Zero) and DAZ (Denormals-Are-Zero) mode configuration for x86/x86_64 and AArch64 processors.

Constants§

DENORMAL_THRESHOLD_F32
DENORMAL_THRESHOLD_F64
Threshold below which values are considered denormal. This is slightly above the actual denormal threshold to catch values that will become denormal after further processing.

Functions§

enable_ftz_daz
Enable FTZ (Flush-To-Zero) and DAZ (Denormals-Are-Zero) modes on x86/x86_64.
flush_denormal_f32
Flush a denormal f32 value to zero.
flush_denormal_f64
Flush a denormal f64 value to zero.
flush_denormals_f32_batch
Batch flush denormals in a slice of f32 values using SIMD.
flush_denormals_f64_batch
Batch flush denormals in a slice of f64 values using SIMD.