test-i386-ssse3.c revision 178d85b8274f9ac82fb553c80760bbbb4044401c
#include <stdio.h>
#include <string.h>
#include <stdint.h>
char hello[16];
uint64_t a = 0x0000000000090007;
uint64_t b = 0x0000000000000000;
uint32_t c;
uint16_t d;
const char e[16] = "LLOaaaaaaaaaaaaa";
const char f[16] = "aaaaaaaaaaaaaaHE";
asm volatile ("pshufb %mm1, %mm0");
asm volatile ("movq %0, %%mm0" : : "r" (a) : "mm0");
asm volatile ("phsubsw %0, %%mm0" : : "m" (b));
asm volatile ("movq %%mm0, %0" : "=m" (a));
asm volatile ("movdqa (%0), %%xmm0" : : "r" (e) : "xmm0");
asm volatile ("palignr $14, (%0), %%xmm0" : : "r" (f));
#if 1 /* SSE4 */
asm volatile ("movq $0x8421000010009c63, %%rax" : : : "rax");
asm volatile ("popcnt %%ax, %%dx" : : : "dx");
asm volatile ("popcnt %%eax, %%ecx" : : : "ecx");
asm volatile ("popcnt %rax, %rax");
asm volatile ("movq %%rax, %0" : "=m" (a));
asm volatile ("movl %%ecx, %0" : "=m" (c));
asm volatile ("movw %%dx, %0" : "=m" (d));
#endif
return 0;
}