108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
#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(i & 0xFFFFFFFF) << 32 | OF_BSWAP32(i >> 32);
#endif
return i;
}
#ifdef __GNUC__
#define OF_BSWAP16(i) \
(__builtin_constant_p(i) ? OF_BSWAP16_CONST(i) : OF_BSWAP16_NONCONST(i))
|
|
>
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
#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;
}
#ifdef __GNUC__
#define OF_BSWAP16(i) \
(__builtin_constant_p(i) ? OF_BSWAP16_CONST(i) : OF_BSWAP16_NONCONST(i))
|