Hi,
is anyone aware of or has done a calculations speed comparison for the four float types (single, double, extended, comp)?
I'm most interested in the first rules of arithmetic.
TIA,
Marc

Mailing lists / fpc-pascal / 2006-10
7 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
is anyone aware of or has done a calculations speed comparison for the four float types (single, double, extended, comp)?
I'm most interested in the first rules of arithmetic.
TIA,
Marc
Marc Santhoff wroteis anyone aware of or has done a calculations speed comparison for the four float types (single, double, extended, comp)?
For the x87, the only difference can come from cache misses/hits due to the different sizes they take up in memory, because the x87 performs all calculations using either extended (the default in FPC) or double precision (user-settable).
Jonas
You can set it also to single. But these settings affect only division, roots and other complex operations.
I read this as "any float calculation is done by using x87 copro". Good to know, so bigger is better in this case.
The only concern left is the question for other CPUs, but in fact the main target is x86.
(Note to myself: have a lok at fpc generated assembler and cpu structures)
You can set it also to single. But these settings affect only division, roots and other complex operations.
Divisions do make a difference for me. How can this setting be made, is there a compiler sitch involved or some symbol to define?
Thanks so far,
Marc
Marc Santhoff wroteDivisions do make a difference for me. How can this setting be made, is there a compiler sitch involved or some symbol to define?
http://community.freepascal.org:10000/docs-html/rtl/math/ setprecisionmode.html
Always check the result, since on architectures where this cannot be changed you will get back whatever is used. On other architectures, like PPC, the precision simply depends on the arguments and cannot be changed at run time.
Jonas
Ah, this was the missing part. I have thought all of this was implemented only inside the compiler itself ...
Many thanks,
Marc
Marc Santhoff wroteAh, this was the missing part. I have thought all of this was implemented only inside the compiler itself ...
It is, except for x86 where the compiler is not involved with the precision used by the FPU since there are no different opcodes.
Jonas