diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-05-26 10:26:34 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-05-26 10:26:34 -0300 |
| commit | d46ed54646b2953007a882f3d4c743741914e202 (patch) | |
| tree | 6b6016ebc3af4563d07a4909f3ed5dd5f2b71ff2 | |
| parent | e2c8c756eea9ecb51b05ade661ef1367e47e623c (diff) | |
| download | lua-d46ed54646b2953007a882f3d4c743741914e202.tar.gz lua-d46ed54646b2953007a882f3d4c743741914e202.tar.bz2 lua-d46ed54646b2953007a882f3d4c743741914e202.zip | |
no more IEEE tricks
| -rw-r--r-- | luaconf.h | 70 |
1 files changed, 1 insertions, 69 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: luaconf.h,v 1.178 2013/04/26 13:08:29 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.179 2013/04/29 17:12:12 roberto Exp roberto $ |
| 3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -479,74 +479,6 @@ | |||
| 479 | #define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) | 479 | #define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) |
| 480 | #define LUA_MAXINTEGER2STR 32 | 480 | #define LUA_MAXINTEGER2STR 32 |
| 481 | 481 | ||
| 482 | |||
| 483 | |||
| 484 | /* | ||
| 485 | ** Some tricks with doubles | ||
| 486 | */ | ||
| 487 | |||
| 488 | #if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && 0 /* { */ | ||
| 489 | /* | ||
| 490 | ** The next definitions activate some tricks to speed up the | ||
| 491 | ** conversion from doubles to integer types, mainly to LUA_UNSIGNED. | ||
| 492 | ** | ||
| 493 | @@ LUA_MSASMTRICK uses Microsoft assembler to avoid clashes with a | ||
| 494 | ** DirectX idiosyncrasy. | ||
| 495 | ** | ||
| 496 | @@ LUA_IEEE754TRICK uses a trick that should work on any machine | ||
| 497 | ** using IEEE754 with a 32-bit integer type. | ||
| 498 | ** | ||
| 499 | @@ LUA_IEEELL extends the trick to LUA_INTEGER; should only be | ||
| 500 | ** defined when LUA_INTEGER is a 32-bit integer. | ||
| 501 | ** | ||
| 502 | @@ LUA_IEEEENDIAN is the endianness of doubles in your machine | ||
| 503 | ** (0 for little endian, 1 for big endian); if not defined, Lua will | ||
| 504 | ** check it dynamically for LUA_IEEE754TRICK (but not for LUA_NANTRICK). | ||
| 505 | ** | ||
| 506 | @@ LUA_NANTRICK controls the use of a trick to pack all types into | ||
| 507 | ** a single double value, using NaN values to represent non-number | ||
| 508 | ** values. The trick only works on 32-bit machines (ints and pointers | ||
| 509 | ** are 32-bit values) with numbers represented as IEEE 754-2008 doubles | ||
| 510 | ** with conventional endianess (12345678 or 87654321), in CPUs that do | ||
| 511 | ** not produce signaling NaN values (all NaNs are quiet). | ||
| 512 | */ | ||
| 513 | |||
| 514 | /* Microsoft compiler on a Pentium (32 bit) ? */ | ||
| 515 | #if defined(LUA_WIN) && defined(_MSC_VER) && defined(_M_IX86) /* { */ | ||
| 516 | |||
| 517 | #define LUA_MSASMTRICK | ||
| 518 | #define LUA_IEEEENDIAN 0 | ||
| 519 | #define LUA_NANTRICK | ||
| 520 | |||
| 521 | |||
| 522 | /* pentium 32 bits? */ | ||
| 523 | #elif defined(__i386__) || defined(__i386) || defined(__X86__) /* }{ */ | ||
| 524 | |||
| 525 | #define LUA_IEEE754TRICK | ||
| 526 | #define LUA_IEEELL | ||
| 527 | #define LUA_IEEEENDIAN 0 | ||
| 528 | #define LUA_NANTRICK | ||
| 529 | |||
| 530 | /* pentium 64 bits? */ | ||
| 531 | #elif defined(__x86_64) /* }{ */ | ||
| 532 | |||
| 533 | #define LUA_IEEE754TRICK | ||
| 534 | #define LUA_IEEEENDIAN 0 | ||
| 535 | |||
| 536 | #elif defined(__POWERPC__) || defined(__ppc__) /* }{ */ | ||
| 537 | |||
| 538 | #define LUA_IEEE754TRICK | ||
| 539 | #define LUA_IEEEENDIAN 1 | ||
| 540 | |||
| 541 | #else /* }{ */ | ||
| 542 | |||
| 543 | /* assume IEEE754 and a 32-bit integer type */ | ||
| 544 | #define LUA_IEEE754TRICK | ||
| 545 | |||
| 546 | #endif /* } */ | ||
| 547 | |||
| 548 | #endif /* } */ | ||
| 549 | |||
| 550 | /* }================================================================== */ | 482 | /* }================================================================== */ |
| 551 | 483 | ||
| 552 | 484 | ||
