[ODE] building 64bit ODE?
tanguy.fautre at spaceapplications.com
Fri Oct 19 08:49:41 MST 2007
Krystian Ligenza wrote:
> Tanguy Fautre pisze:
>> Krystian Ligenza wrote:
>>> I have tried to build a 64bit version of ODE, but get lots of errors
>>> from opcode:
>>> error C4235: nonstandard extension used : '__asm' keyword not
>>> supported on this architecture \opcode\Ice\IceFPU.h 47
Ok, I've looked at the IceFPU.h file. Here is the faulty part:
//! Fast square root for floating-point values.
inline_ float FastSqrt(float square)
mov eax, square
sub eax, 0x3F800000
sar eax, 1
add eax, 0x3F800000
mov [retval], eax
It strikes me that the asm version has no reason not to be in C++.
Without testing, I would say it is the same as the following (note the
use of a union instead of pointers/casts to solve aliasing issues).
v.fSquare = square;
v.iSquare -= 0x3F800000
v.iSquare >>= 1
v.iSquare += 0x3F800000
Can anyone else check that this is correct ? If it is, I also see no
reason to have two different versions (one using sqrt() and the
optimized version), shouldn't we just keep the C++ optimized version ?
More information about the ODE