Exotic architectures the standards committees care about

后端 未结 7 931
时光说笑
时光说笑 2020-11-22 01:23

I know that the C and C++ standards leave many aspects of the language implementation-defined just because if there is an architecture with other characteristics, it would b

7条回答
  •  失恋的感觉
    2020-11-22 01:51

    Full IEEE 754 compliance is rare in floating-point implementations. And weakening the specification in that regard allows lots of optimizations.

    For example the subnorm support differers between x87 and SSE.

    Optimizations like fusing a multiplication and addition which were separate in the source code slightly change the results too, but is nice optimization on some architectures.

    Or on x86 strict IEEE compliance might require certain flags being set or additional transfers between floating point registers and normal memory to force it to use the specified floating point type instead of its internal 80bit floats.

    And some platforms have no hardware floats at all and thus need to emulate them in software. And some of the requirements of IEEE 754 might be expensive to implement in software. In particular the rounding rules might be a problem.

    My conclusion is that you don't need exotic architectures in order to get into situations were you don't always want to guarantee strict IEEE compliance. For this reason were few programming languages guarantee strict IEEE compliance.

提交回复
热议问题