On Tue, 23 Aug 2005 06:22:46 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co m> wrote:
In some 32-bit processors, I believe there is no microcode support for
performing some floating point operations in less than 80 bits. In
other words, everything's already being converted.
The FPU of the x86 line always performs calculations at 80 bit
precision, that's why you don't get any speedup for using float
instead of double (other than some memory transfer savings).
NB: In an earlier discussion I was notified that you can explicitly
put the FPU into 32-bit IEEE mode, but (a) I don't think it's actually
faster -- Intel just provides this feature to accomodate existing
programs; and (b) the .NET libraries don't use this mode anyway.
<ki******@hanma il.net> wrote:
2. There are two reasons why I want float based math
First, float precision math is 2x faster than double. It is said by
Atmapuri.
Tip: Don't believe everything you read on the Internet...
By the way, I think professional game developers use the FPU's SIMD
unit (MMX/SSE/3DNow) extensively for their math. These units do
support single-precision math natively, and you may in fact get a
factor 2 speedup if you use them (since they split their 64-bit
registers into two 32-bit registers for that job). However, .NET does
not support these units at all, so that won't help you either.
--
http://www.kynosarges.de