mirror of https://github.com/lua/lua
no more IEEE tricks
This commit is contained in:
parent
e2c8c756ee
commit
d46ed54646
70
luaconf.h
70
luaconf.h
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: luaconf.h,v 1.178 2013/04/26 13:08:29 roberto Exp roberto $
|
||||
** $Id: luaconf.h,v 1.179 2013/04/29 17:12:12 roberto Exp roberto $
|
||||
** Configuration file for Lua
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -479,74 +479,6 @@
|
|||
#define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n))
|
||||
#define LUA_MAXINTEGER2STR 32
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** Some tricks with doubles
|
||||
*/
|
||||
|
||||
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && 0 /* { */
|
||||
/*
|
||||
** The next definitions activate some tricks to speed up the
|
||||
** conversion from doubles to integer types, mainly to LUA_UNSIGNED.
|
||||
**
|
||||
@@ LUA_MSASMTRICK uses Microsoft assembler to avoid clashes with a
|
||||
** DirectX idiosyncrasy.
|
||||
**
|
||||
@@ LUA_IEEE754TRICK uses a trick that should work on any machine
|
||||
** using IEEE754 with a 32-bit integer type.
|
||||
**
|
||||
@@ LUA_IEEELL extends the trick to LUA_INTEGER; should only be
|
||||
** defined when LUA_INTEGER is a 32-bit integer.
|
||||
**
|
||||
@@ LUA_IEEEENDIAN is the endianness of doubles in your machine
|
||||
** (0 for little endian, 1 for big endian); if not defined, Lua will
|
||||
** check it dynamically for LUA_IEEE754TRICK (but not for LUA_NANTRICK).
|
||||
**
|
||||
@@ LUA_NANTRICK controls the use of a trick to pack all types into
|
||||
** a single double value, using NaN values to represent non-number
|
||||
** values. The trick only works on 32-bit machines (ints and pointers
|
||||
** are 32-bit values) with numbers represented as IEEE 754-2008 doubles
|
||||
** with conventional endianess (12345678 or 87654321), in CPUs that do
|
||||
** not produce signaling NaN values (all NaNs are quiet).
|
||||
*/
|
||||
|
||||
/* Microsoft compiler on a Pentium (32 bit) ? */
|
||||
#if defined(LUA_WIN) && defined(_MSC_VER) && defined(_M_IX86) /* { */
|
||||
|
||||
#define LUA_MSASMTRICK
|
||||
#define LUA_IEEEENDIAN 0
|
||||
#define LUA_NANTRICK
|
||||
|
||||
|
||||
/* pentium 32 bits? */
|
||||
#elif defined(__i386__) || defined(__i386) || defined(__X86__) /* }{ */
|
||||
|
||||
#define LUA_IEEE754TRICK
|
||||
#define LUA_IEEELL
|
||||
#define LUA_IEEEENDIAN 0
|
||||
#define LUA_NANTRICK
|
||||
|
||||
/* pentium 64 bits? */
|
||||
#elif defined(__x86_64) /* }{ */
|
||||
|
||||
#define LUA_IEEE754TRICK
|
||||
#define LUA_IEEEENDIAN 0
|
||||
|
||||
#elif defined(__POWERPC__) || defined(__ppc__) /* }{ */
|
||||
|
||||
#define LUA_IEEE754TRICK
|
||||
#define LUA_IEEEENDIAN 1
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
/* assume IEEE754 and a 32-bit integer type */
|
||||
#define LUA_IEEE754TRICK
|
||||
|
||||
#endif /* } */
|
||||
|
||||
#endif /* } */
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue