冲洗到零行为浮点运算 [英] flush-to-zero behavior in floating-point arithmetic

查看:207
本文介绍了冲洗到零行为浮点运算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然,据我记得,IEEE 754只字未提刷新到零的方式来处理正规化数的速度更快,某些架构提供这种模式(如的http:// docs.sun.com/source/806-3568/ncg_lib.html )。

While, as far as I remember, IEEE 754 says nothing about a flush-to-zero mode to handle denormalized numbers faster, some architectures offer this mode (e.g. http://docs.sun.com/source/806-3568/ncg_lib.html ).

在此技术文档的特定情况下,非正规数的标准处理是默认的,并刷新到零,必须明确激活。在默认模式下,非正规数也在软件,这是较慢的处理。

In the particular case of this technical documentation, standard handling of denormalized numbers is the default, and flush-to-zero has to be activated explicitly. In the default mode, denormalized numbers are also handled in software, which is slower.

我的静态分析仪嵌入式C它试图predict正确的工作(如果有时IM precise)的范围内,可以在运行时发生的值。它的目的是因为它旨在是可用来排除的东西在运行时(例如用于关键嵌入式$ C $三)出错的可能性是正确的。这需要捕获了在分析过程中所有可能的行为,并在浮点计算产生的,因此所有可能的值。

I work on a static analyzer for embedded C which tries to predict correct (if sometimes imprecise) ranges for the values that can happen at run-time. It aims at being correct because it is intended to be usable to exclude the possibility of something going wrong at run-time (for instance for critical embedded code). This requires having captured all possible behaviors during the analysis, and therefore all possible values produced during floating-point computations.

在这种情况下,我的问题是双重的:

In this context, my question is twofold:


  1. 嵌入式架构之中,是否有的架构,只提供冲洗到零?他们或许会没有正确宣传自己为IEEE 754,但可以提供近距离足够的IEEE 754风格的浮点运算。

  1. among the embedded architectures, are there architectures that offer only flush-to-zero? They would perhaps not have to right to advertise themselves as "IEEE 754", but could offer close-enough IEEE 754-style floating-point operations.

有关同时提供,在嵌入式环境的体系结构,是不是的冲洗到零可能由系统被激活,以使反应时间更predictable(这些嵌入式系统的共同约束)?

For the architectures that offer both, in an embedded context, isn't flush-to-zero likely to be activated by the system, in order to make the reaction time more predictable (a common constraint for these embedded systems)?

在我使用的浮点值的区间算术处理刷新到零的很简单,我的问题是更多的我是否做到这一点。

Handling flush-to-zero in the interval arithmetic that I use for floating-point values is simple enough if I know I have to do it, my question is more whether I have to do it.

推荐答案

有两个问题。有迹象表明,冲洗到零只支持平台,而且有很多的平台,其中冲洗到零的是默认的。

Yes to both questions. There are platforms that support flush-to-zero only, and there are many platforms where flush-to-zero is the default.

您也应该知道,许多嵌入式和DSP平台使用了非正规为零的模式,这是在浮点语义的另一皱纹。

You should also be aware that many embedded and dsp platforms use a "Denormals Are Zero" mode, which is another wrinkle in the floating-point semantics.

修改保税区与DAZ的进一步解释:

Edit further explanation of FTZ vs. DAZ:

在保税区,当一个操作将正常的算术下产生规格化的结果,零而是返回。注意,一些实施始终平齐正零,而其他人可能冲洗到正或负零。这也可能是最好不要依赖任一行为。

In FTZ, when an operation would produce a denormal result under the usual arithmetic, a zero is returned instead. Note that some implementations always flush to positive zero, whereas others may flush to either positive or negative zero. It's probably best not to depend on either behavior.

在DAZ,当输入到操作是非规格化,零是在它的位置被取代。再次,有哪些零点将取代没有通用的保证。

In DAZ, when an input to an operation is a denormal, a zero is substituted in its place. Again, there's no general guarantee about which zero will be substituted.

这支持这些模式一些实现允许它们独立设置(和一些支持仅在两个中的一个),因此,可能有必要让你能模型两种模式下独立地以及共同

Some implementations that support these modes allow them to be set independently (and some support only one of the two), so it may be necessary for you to be able model either mode independently as well as together.

还要注意一些实现结合这两种模式为刷新到零。下的ARM VFP刷新归零模式既保税区和DAZ,例如

Note also that some implementations combine these two modes into "Flush to Zero". The ARM VFP "flush to zero" mode is both FTZ and DAZ, for example.

这篇关于冲洗到零行为浮点运算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆