将非规范化的数字冲洗为零 [英] Flushing denormalised numbers to zero
问题描述
我一直在网上搜索无济于事.
I've scoured the web to no avail.
Xcode和Visual C ++是否可以将非规范化数字视为0?我本以为IDE偏好设置中有一个选项可以打开该选项,但似乎找不到它.
Is there a way for Xcode and Visual C++ to treat denormalised numbers as 0? I would have thought there's an option in the IDE preferences to turn on this option but can't seem to find it.
我正在做一些跨平台的音频工作,需要停止某些处理器占用资源.
I'm doing some cross-platform audio stuff and need to stop certain processors hogging resources.
欢呼
推荐答案
您正在寻找一种平台定义的方法来设置MXCSR寄存器中的FTZ和/或DAZ(在具有SSE或x86-64的x86上);参见 https://stackoverflow.com/a/2487733/567292
You're looking for a platform-defined way to set FTZ and/or DAZ in the MXCSR register (on x86 with SSE or x86-64); see https://stackoverflow.com/a/2487733/567292
通常,这称为_controlfp
之类的东西; Microsoft文档位于 http://msdn.microsoft.com/en-us/library/e9b52ceh.aspx
Usually this is called something like _controlfp
; Microsoft documentation is at http://msdn.microsoft.com/en-us/library/e9b52ceh.aspx
您还可以使用_MM_SET_FLUSH_ZERO_MODE
宏:
You can also use the _MM_SET_FLUSH_ZERO_MODE
macro: http://msdn.microsoft.com/en-us/library/a8b5ts9s(v=vs.71).aspx - this is probably the most cross-platform portable method.
这篇关于将非规范化的数字冲洗为零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!