做任何真实世界的CPU不使用IEEE 754? [英] Do any real-world CPUs not use IEEE 754?
问题描述
我正在为一个数字/统计库优化一个排序函数,这个假设是在过滤掉任何NaN并做了一点点操作之后,浮点数可以作为32位整数进行比较,而不会改变结果并且可以加倍比较为64位整数。
这似乎加快了将这些数组排序在40%左右的程度,而且只要浮点数的位级表示是IEEE 754.是否有任何人们真正使用的CPU(不包括嵌入式设备,这个库不是针对的)使用一些其他的表示方法,可能会打破这个假设?
以下是FPA标准及其采用的简要概述。 IEEE 754:Intel x86和所有RISC系统(IBM Power
和PowerPC,Compaq / DEC Alpha,HP PA-RISC,
$ b Motorola 68xxx和88xxx,SGI(MIPS)R-xxxx,
Sun SPARC等);
VAX:Compaq / DEC
IBM S / 390:IBM(但在1998年,IBM为S / 390增加了一个IEEE 754
选项)
Cray:X-MP,Y-MP,C-90;其他克雷模型已经
基于Alpha和SPARC处理器
IEEE-754算法。
除非您计划在相当奇特的CPU架构上支持您的库,否则现在可以安全地99%的CPU符合IEEE 754标准。
I'm optimizing a sorting function for a numerics/statistics library based on the assumption that, after filtering out any NaNs and doing a little bit twiddling, floats can be compared as 32-bit ints without changing the result and doubles can be compared as 64-bit ints.
This seems to speed up sorting these arrays by somewhere on the order of 40%, and my assumption holds as long as the bit-level representation of floating point numbers is IEEE 754. Are there any real-world CPUs that people actually use (excluding in embedded devices, which this library doesn't target) that use some other representation that might break this assumption?
Other than flawed Pentiums, any x86 or x64-based CPU is using IEEE 754 as their floating-point arithmetic standard.
Here are a brief overview of the FPA standards and their adoptions.
IEEE 754: Intel x86, and all RISC systems (IBM Power
and PowerPC, Compaq/DEC Alpha, HP PA-RISC,
Motorola 68xxx and 88xxx, SGI (MIPS) R-xxxx,
Sun SPARC, and others);
VAX: Compaq/DEC
IBM S/390: IBM (however, in 1998, IBM added an IEEE 754
option to S/390)
Cray: X-MP, Y-MP, C-90; other Cray models have been
based on Alpha and SPARC processors with
IEEE-754 arithmetic.
Unless your planning on supporting your library on fairly exotic CPU architectures, it is safe to assume that for now 99% of CPUs are IEEE 754 compliant.
这篇关于做任何真实世界的CPU不使用IEEE 754?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!