> On Wed, Sep 27, 2017 at 08:40:26AM +0200, Alexandre Ratchov wrote:
> > Even on modern amd64s integer arithmetics and bitwise operations are
> > faster (and more precise in many cases) than floating point
> > equivalents.
> 
> Can you actually substanciate this claim? The basic x87 instructions
> (FLD, FST, FCOM etc) all run in one cycle with a latency of 2 according
> to Agner. That's generally not worth the cost of moving from x87 to GP
> registers. Precision might have been a problem two decades ago when many
> compilers were too bad at correct parsing of float literals, but that
> has been fixed in the mean time even without using C99 hex float
> literals. The short answer is that the original msun code has been
> optimized for a hardware environment that is substantially different
> from modern CPUs. Many of the small details are no longer optimal.

The integer arithmetics and bitwise operations are not slower than the
float ones.  Hence, since this is machine independent code, the approach
taken is sane.

Reply via email to