Mail Archives: djgpp/1997/02/04/06:27:31
In article <32f3a643 DOT 25054189 AT news DOT ox DOT ac DOT uk>, George Foot
<mert0407 AT sable DOT ox DOT ac DOT uk> writes
>Doubles are more accurate and apparently faster than floats.
^^^^^^
Can we *please* kill this myth.
On Pentium there is NO speed difference between using a float or double.
On 387,486/487 float is slightly *faster* to load, store or read from
ram as an operand, than a double.
On top of that, you have just consumed 8 bytes of ram bandwidth and
cache instead of 4, and imposed extra alignment restrictions on
variables (which can cause extra code to be emitted on some compilers).
There are times when a 'register long double' (80 bit) is faster than
either, *only* because the optimiser is allowed to keep that type in
internal fpu registers across calculations. Only do this if you know
that transient values will stay on the fpu.
On Intel processors only use doubles if you need the precision.
---
Paul Shirley: shuffle chocolat before foobar for my real email address
- Raw text -