lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm using the DirectX9c SDK from Feb. 2006 (the latest). Imho maybe we can assume the people behind DirectX have a good reason to do something as potentially 'dangerous' to other libraries as setting the FPU to single precision.

A google search can also produce pages about the loss of speed when using the 'preserve FPU' flag, like (quote: "For games, you typically don't want the performance hit of having the FP unit working in double-precision.").

With SSE of course it can be avoided, but what about DX drivers on a CPU without SSE? Btw, can 32-bit float-s really benefit from SSE2 over 64-bit double-s? Or maybe double-s are faster than float-s on 64-bit CPUs?

So for now I'm sticking with having DirectX setting the (perhaps not so very deprecated :) FPU to single precision and prefering float over double in our game engine until DirectX itself converts to using double-s.

Anyway, today I got LuaJIT to work, big thanks to Roberto for this tip!

- #if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
-     (defined(__i386) || defined (_M_IX86) || defined(__i386__))
+ #if 0


----- Original Message ----- From: "SevenThunders" <>
To: <>
Sent: Thursday, March 16, 2006 6:27 AM
Subject: Re: ANN: LuaJIT 1.1.0

Although I don't know much about DirectX, it is the SSE2 instructions that
see a large boost using 32 bit floats, since they can do twice as many
multiplies per clock cycle.  Moreover if the modern Directx drivers are
using the CPU I would be surprised if they are not using the more modern SSE
and SSE2 instructions over the old x86 FPU.  Thus one would never have to
employ the nasty switch to single precision on the FPU (which probably sucks
up a lot of clock cycles in it's own right).

Perhaps the question is what version of DirectX are you using?  Actually a
google search produces this link

Tell your DirectX to leave the deprecated FPU alone!
View this message in context:
Sent from the Lua - General forum at