-static inline int parity(uint32_t x)
-{
-#if !defined __i386__ || !defined __GNUC__
- x ^= x >> 16;
- x ^= x >> 8;
- x ^= x >> 4;
- return BIT(0x6996, x & 0xf);
-#else
- __asm( "movl %1, %%eax\n"
- "mov %%ax, %%cx\n"
- "shrl $0x10, %%eax\n"
- "xor %%ax, %%cx\n"
- "xor %%ch, %%cl\n"
- "setpo %%al\n"
- "movzx %%al, %0\n": "=r"(x) : "r"(x): "eax","ecx");
- return x;
-#endif
-}