简体   繁体   English

IEEE浮点和快速浮点表示在内存中

[英]IEEE floating point and fast floating point representation in memory

The BFF-533 processor from Analog Devices does not offer native floating point support but does offer floating point emulation. ADI公司的BFF-533处理器不提供本机浮点支持,但提供浮点仿真。

Using the IDE VisualDSP++, the user is allowed to select between High Performing floating point and strict IEEE compliance. 使用IDE VisualDSP ++,允许用户在高性能浮点和严格的IEEE兼容性之间进行选择。

From what I understand, the difference between these two result in a different representation of a floating point value in memory, so I did the following test: 根据我的理解, 这两者之间的差异导致内存中浮点值的不同表示,所以我做了以下测试:

union TestType
{
    float hello;
    char test[4];   
};

TestType tt;
tt.hello = 0.00123456789;

I compiled and ran this with both options, expecting to see a different value in the test array, but I got the same each run: 我用两个选项编译并运行它,期望在测试数组中看到不同的值,但每次运行都得到相同的值:

在此输入图像描述

Can someone explain why I'm seeing what appears to be the IEEE representation in both runs? 有人可以解释为什么我在两次运行中看到似乎是IEEE代表吗?

The document you reference discusses a User-Defined fastfloat16 type. 您引用的文档讨论了用户定义的fastfloat16类型。 You use the native float type here. 您在此处使用本机float类型。 I don't think they're equivalent, regardless of the VisualDSP settings. 无论VisualDSP设置如何,我都不认为它们是等效的。

"Strict IEEE compliance" is usually interpreted as "even the edge cases are handled correctly". “严格的IEEE合规性”通常被解释为“即使边缘情况也能正确处理”。 Edge cases for IEE754 are things like denormals, division by zero, infinities, Not-a-Number etc. One example, in IEEE754 NaN != NaN . IEE754的边缘情况是非正规数,除零,无穷大,非数字等。例如,在IEEE754 NaN != NaN This means you can't do a fast 32 bits comparison. 这意味着您无法进行快速32位比较。 Another example is that IEEE754 mandates that the basic math operations are exact to the last bit. 另一个例子是IEEE754要求基本数学运算精确到最后一位。 There's a significant speedup achievable by using the IEEE754 float layout, but not IEEE754 math. 使用IEEE754浮点布局可以实现显着的加速,但不是IEEE754数学。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM