Differences From Artifact [2804045e97]:
- File
src/OFMacros.h
— part of check-in
[b91a8283fe]
at
2010-03-05 11:52:18
on branch 0.2
— Merge a few changesets from the default branch into the 0.2 branch.
Changesets:
* b95fcaa6d694
* 804c68d222b4
* da8cd738da3d
* 1109d5ce3419
* d03f5c1ca95d
* 2a7017722165
* 4fccdc79eeb7
* d228149fbc04
* 8782d412a4a6 (user: js, size: 4776) [annotate] [blame] [check-ins using] - File src/macros.h — part of check-in [42886185fd] at 2010-02-19 16:36:20 on branch trunk — Update copyright. (user: js, size: 4776) [annotate] [blame] [check-ins using]
To Artifact [869ffd926c]:
- File src/macros.h — part of check-in [3588e29b9c] at 2010-04-01 22:15:39 on branch trunk — Use __asm__ instead of asm to prevent conflicts. (user: js, size: 4813) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
65 66 67 68 69 70 71 | ((uint64_t)i & UINT64_C(0x000000000000FF00)) << 40 | \ ((uint64_t)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) | | | | | | | | | | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | ((uint64_t)i & UINT64_C(0x000000000000FF00)) << 40 | \ ((uint64_t)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) __asm__ ("lhbrx %0, 0, %1" : "=r"(i) : "r"(&i), "m"(i)); #elif defined(OF_ARM_ASM) __asm__ ("rev16 %0, %0" : "=r"(i) : "0"(i)); #else i = (i & UINT16_C(0xFF00)) >> 8 | (i & UINT16_C(0x00FF)) << 8; #endif return i; } static OF_INLINE uint32_t OF_BSWAP32_NONCONST(uint32_t i) { #if defined(OF_X86_ASM) || defined(OF_AMD64_ASM) __asm__ ("bswap %0" : "=q"(i) : "0"(i)); #elif defined(OF_PPC_ASM) __asm__ ("lwbrx %0, 0, %1" : "=r"(i) : "r"(&i), "m"(i)); #elif defined(OF_ARM_ASM) __asm__ ("rev %0, %0" : "=r"(i) : "0"(i)); #else i = (i & UINT32_C(0xFF000000)) >> 24 | (i & UINT32_C(0x00FF0000)) >> 8 | (i & UINT32_C(0x0000FF00)) << 8 | (i & UINT32_C(0x000000FF)) << 24; #endif return i; } static OF_INLINE uint64_t OF_BSWAP64_NONCONST(uint64_t i) { #if defined(OF_AMD64_ASM) __asm__ ("bswap %0" : "=r"(i) : "0"(i)); #elif defined(OF_X86_ASM) __asm__ ("bswap %%eax\n\t" "bswap %%edx\n\t" "xchgl %%eax, %%edx" : "=A"(i) : "0"(i)); #else i = (uint64_t)OF_BSWAP32_NONCONST(i & 0xFFFFFFFF) << 32 | OF_BSWAP32_NONCONST(i >> 32); #endif return i; } |
︙ | ︙ |