3 ms·
It's to satisfy IEEE 754 and it's been this way for decades.
by duped 8d ago
It's to satisfy IEEE 754 and it's been this way for decades.
- pohl 8d agoDoes that mean that the ARM processors in the writeup are not satisfying IEEE 754?
- tasty_freeze 8d agoIt probably means Apple spent the silicon to handle subnormals at full speed in hardware, rather than triggering a slow microcode handler for such numbers.
- adrian_b 7d agoAll the tested CPUs implement the standard and they implement it in the right way, except for Intel, who has chosen to save some bucks even if this decision might cause unpredictable financial losses for naive customers, who might choose to use the dangerous FTZ/DAZ options to avoid the Intel slowdown, which in turn may cause unpredictable computation errors, with even more unpredictable consequences. Some poster has linked a Mastodon thread, where Fabian Giesen explains that handling in hardware the subnormals is cheap in floating-point adders and in fused-multiply-add (FMA) execution units. Many processors do the multiplications in the FMA execution units, so there is no penalty for them to do the subnormal handling in the right way. On the other hand, some CPUs, including the Intel big cores, have some floating-point multipliers that are separate from the FMA units. The reason is that those separate multipliers can have lower latencies, typically by 1 or 2 clock cycles, which may help those CPUs to win some benchmarks, especially when running unoptimized legacy programs (in optimized programs, most multiplications are combined with additions into FMA operations). The separate multipliers are simplified in comparison with those included in the FMA units, and handling subnormals in them would be expensive, because then they would become so complex that there would be no advantage for them to be separate multipliers. Which is why Intel does not handle subnormal multiplication in hardware, but a microprogram is invoked for this.
- david-gpu 8d agoI don't know who is down voting you. AFAIK IEEE 754:2008 does require support for subnormals. You can optionally have modes that flush them to zero, but you must support subnormals. I haven't done any work on this stuff since 2019, so my memory may be hazy.