Skip to content

daemon: Link with -ffast-math

Georg Chini requested to merge gchini/pulseaudio:fast_math_fix into master

Commit fd9e3452 removed -ffast-math from the compile flags. Under some conditions this may lead to massive slowdown of floating point operations when underflows or denormals are encountered. In particular, this problem was observed with the soxr resampler after applying !120 (merged)

Therefore this patch adds -ffast-math to the link flags of the pulseaudio daemon. Linking with -ffast-math adds a procedure set_fast_math() to the startup code of the daemon. On x86, the procedure sets bit 6 and 15 of the mxcsr register. When these bits are set, denormals and results of underflowing operations are truncated to 0.

For (old) discussions about the topic, see https://stackoverflow.com/questions/9314534/ or https://software.intel.com/en-us/articles/x87-and-sse-floating-point-assists-in-ia-32-flush-to-zero-ftz-and-denormals-are-zero-daz

Edited by Georg Chini

Merge request reports