Changeset 1402
- Timestamp:
- May 20, 2012, 2:30:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/math/half.cpp
r1188 r1402 47 47 static uint16_t const basetable[512] = 48 48 { 49 #define S1(i) (((i) < 103) ? 0x0000 : \50 ((i) < 113) ? 0x0400 >> (0x1f & (113 - (i))) : \51 ((i) < 143) ? ((i) - 112) << 10 : 0x7c00 )49 #define S1(i) (((i) < 103) ? 0x0000u : \ 50 ((i) < 113) ? 0x0400u >> (0x1f & (113 - (i))) : \ 51 ((i) < 143) ? ((i) - 112) << 10 : 0x7c00u) 52 52 S256(0), 53 53 #undef S1 54 #define S1(i) ( 0x8000| basetable[i])54 #define S1(i) (uint16_t)(0x8000u | basetable[i]) 55 55 S256(0), 56 56 #undef S1 … … 117 117 * http://lol.zoy.org/blog/2012/4/3/beyond-de-bruijn for an explanation 118 118 * of how the value 0x5a1a1a2u was obtained. */ 119 static int const shifttable[16] =120 { 121 23, 22, 21, 15, -1, 20, 18, 14, 14, 16, 19, -1, 17, -1, -1, -1,119 static uint32_t const shifttable[16] = 120 { 121 23, 22, 21, 15, 0, 20, 18, 14, 14, 16, 19, 0, 17, 0, 0, 0, 122 122 }; 123 123 static uint32_t const shiftmagic = 0x5a1a1a2u;
Note: See TracChangeset
for help on using the changeset viewer.