Mail Archives: djgpp/1997/01/20/17:12:26
gpt20 AT thor DOT cam DOT ac DOT uk (G.P. Tootell) wrote:
>i would be better writing - (and changing a to a float)
>
>a=1.0/b; (because fdiv is still faster than idiv in most cases)
>c=(float)x*a;
>d=(float)y*a;
>
>ie. to change the integers into floating wherever possible to make use of the
>fmul timings, which outstrip every other timing even in worst case!
>
>
>so there must be a catch somewhere of course ;)
>perhaps the changing from float->int and vice versa takes a lot of time?
>anyone?
I don't have the excact numbers, but float to int, and int to float
conversions are supposed to be very slow. So normaly it is a good idea
to avoid them. But since the FPU can process one instruction in
parallel with the CPU (four on Cyrics I heard?), you can execute all
FPU instrucions on *ONE* cycle as long as you have enough integer
instructions to fill in between each FPU instruction.
Kurt. Programmer Funcom/R&D
The above expressions is not ment to represent Funcom.
- Raw text -