Bug 415757 - vex x86->IR: unhandled instruction bytes: 0x66 0xF 0xCE (bswapw).
[valgrind.git] / none / tests / x86 / bswapw.c
blobadb0bf617cde9cf5d0c4635a8cc545b91d40634e
2 #include <stdio.h>
4 typedef unsigned int UInt;
6 int main ( void )
9 #define GO16(REG,VALUE) \
10 value = VALUE; \
11 __asm__ __volatile__( \
12 "pushl %%" REG " \n\t" \
13 "movl 0(" "%0" "), %%" REG " \n\t" \
14 ".byte 0x66 \n\t" "bswapl %%" REG "\n\t" \
15 "movl %%" REG ", 0(" "%0" ") \n\t" \
16 "popl %%" REG "\n" \
17 : : "r" (&value) : REG, "memory", "cc" \
18 ); \
19 printf("0x%08x\n", value)
21 UInt value;
22 GO16("eax", 0x12345678);
23 GO16("ebx", 0x23456789);
24 GO16("ecx", 0x3456789a);
25 GO16("edx", 0x456789ab);
26 GO16("esi", 0x56789abc);
27 GO16("edi", 0x6789abcd);
28 //GO16("ebp", 0x789abcde); // The compiler complains
30 return 0;