Mail Archives: djgpp/1998/06/19/12:30:34
On Fri, 19 Jun 1998, Rob Kramer wrote:
> Hi all!
>
> Can anyone make a guess if multiplications/devisions in fixed point math
> are still faster on a machine that has a FPU? I was wondering if it would
> do any good to #define my code to use conventional floats if the machine
> supports it. (I'm using Allegro's fixed math stuff b.t.w)
Floating point divides and multiplies are somewhat faster (20%-100%) than
fixed point on the
486 DX
(AMD) 586 & K6
Pentium II
and are much faster (100% - 300%) on the
pentium
PPro
and are slower on the
486 SX -- no coprocessor
386/387 -- but then again, practically every 386 machine in existence
has no coprocessor.
Unless you are specifically targetting 386's or 486 SX's it makes sense to
use floating point. It provides more accuracy (except where you *need* to
do integer math), and more speed. In very small, tight, time-critical
inner loops where you convert from floats to ints a lot you *might* want
to stick to fixed point *within* the loop, but in general it's not a
sin to use the FPU.
Cheers,
Elliott Oti
kamer 104, tel (030-253) 2516 (RvG)
http://www.fys.ruu.nl/~oti
- Raw text -