digitalmars.D.learn - Flushing denormals to zero
- bearophile <bearophileHUGS lycos.com> Feb 16 2012
- Mantis <mail.mantis.88 gmail.com> Feb 17 2012
- Don Clugston <dac nospam.com> Feb 17 2012
After seeing this interesting thread: http://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x Do you know if there's a simple way to perform _MM_SET_FLUSH_ZERO_MODE in D? According to Agner that operation is not needed on Sandy Bridge processors, but most CPUs around are not that good: http://www.agner.org/optimize/blog/read.php?i=142 Bye, bearophile
Feb 16 2012
17.02.2012 4:30, bearophile пишет:After seeing this interesting thread: http://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x Do you know if there's a simple way to perform _MM_SET_FLUSH_ZERO_MODE in D? According to Agner that operation is not needed on Sandy Bridge processors, but most CPUs around are not that good: http://www.agner.org/optimize/blog/read.php?i=142 Bye, bearophile
but it isn't. Anyway, the assembly code to change FPU control word is pretty tiny: http://software.intel.com/en-us/articles/x87-and-sse-floating-point-assists-in-ia-32-flush-to-zero-ftz-and-denormals-are-zero-daz/
Feb 17 2012
On 17/02/12 09:09, Mantis wrote:17.02.2012 4:30, bearophile пишет:After seeing this interesting thread: http://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x Do you know if there's a simple way to perform _MM_SET_FLUSH_ZERO_MODE in D? According to Agner that operation is not needed on Sandy Bridge processors, but most CPUs around are not that good: http://www.agner.org/optimize/blog/read.php?i=142 Bye, bearophile
but it isn't.
That's because the x87 doesn't support flush-to-zero, and 32-bit x86 doesn't necessarily have SSE. But it should probably be added for 64 bit. Anyway, the assembly code to change FPU control word ispretty tiny: http://software.intel.com/en-us/articles/x87-and-sse-floating-point-assists-in-ia-32-flush-to-zero-ftz-and-denormals-are-zero-daz/
Feb 17 2012








Don Clugston <dac nospam.com>