Overview
Comment: | Prevent repeated evaluation of i in OF_BSWAP{16,32,64}_CONST. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c5b72902da23e15e478f22a6d95da482 |
User & Date: | js on 2010-04-10 13:32:30 |
Other Links: | manifest | tags |
Context
2010-04-10
| ||
13:46 | Improve OF_ROL. check-in: 11489e7218 user: js tags: trunk | |
13:32 | Prevent repeated evaluation of i in OF_BSWAP{16,32,64}_CONST. check-in: c5b72902da user: js tags: trunk | |
2010-04-09
| ||
20:11 | Rename -[cacheWrites] to -[bufferWrites]. check-in: c5c17fdd30 user: js tags: trunk | |
Changes
Modified src/macros.h from [92c862e4a0] to [0c7fd6a945].
︙ | ︙ | |||
43 44 45 46 47 48 49 | # elif defined(__ppc__) || defined(__PPC__) # define OF_PPC_ASM # elif defined(__arm__) || defined(__ARM__) # define OF_ARM_ASM # endif #endif | > | > | | > > > | > | | | | > > > | > | | | | | | | | > | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | # elif defined(__ppc__) || defined(__PPC__) # define OF_PPC_ASM # elif defined(__arm__) || defined(__ARM__) # define OF_ARM_ASM # endif #endif static OF_INLINE uint16_t OF_BSWAP16_CONST(uint16_t i) { return (i & UINT16_C(0xFF00)) >> 8 | (i & UINT16_C(0x00FF)) << 8; } static OF_INLINE uint32_t OF_BSWAP32_CONST(uint32_t i) { return (i & UINT32_C(0xFF000000)) >> 24 | (i & UINT32_C(0x00FF0000)) >> 8 | (i & UINT32_C(0x0000FF00)) << 8 | (i & UINT32_C(0x000000FF)) << 24; } static OF_INLINE uint64_t OF_BSWAP64_CONST(uint64_t i) { return (i & UINT64_C(0xFF00000000000000)) >> 56 | (i & UINT64_C(0x00FF000000000000)) >> 40 | (i & UINT64_C(0x0000FF0000000000)) >> 24 | (i & UINT64_C(0x000000FF00000000)) >> 8 | (i & UINT64_C(0x00000000FF000000)) << 8 | (i & UINT64_C(0x0000000000FF0000)) << 24 | (i & UINT64_C(0x000000000000FF00)) << 40 | (i & UINT64_C(0x00000000000000FF)) << 56; } static OF_INLINE uint16_t OF_BSWAP16_NONCONST(uint16_t i) { #if defined(OF_X86_ASM) || defined(OF_AMD64_ASM) __asm__ ("xchgb %h0, %b0" : "=Q"(i) : "0"(i)); #elif defined(OF_PPC_ASM) |
︙ | ︙ |