Always false float comparisons

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon May 16 04:53:12 PDT 2016


On 5/16/2016 3:33 AM, Andrei Alexandrescu wrote:
> On 5/16/16 4:10 AM, Walter Bright wrote:
>> FP behavior has complex trade-offs with speed, accuracy, compatibility,
>> and size. There are no easy, obvious answers.
>
> That's a fair statement. My understanding is also that 80-bit math is on the
> wrong side of the tradeoff simply because it's disproportionately slow (again I
> cite http://nicolas.limare.net/pro/notes/2014/12/12_arit_speed/). All modern
> ALUs I looked at have 32- and 64-bit FP units only. I'm trying to figure why. --


I think it is slow because no effort has been put into speeding it up. All the 
effort went into SIMD. The x87 FPU is a library module that is just plopped onto 
the chip for compatibility.

The x87 register stack also sux because it's hard to generate good code for. 
That didn't help.


More information about the Digitalmars-d mailing list