target-i386: Use mulu2 and muls2
[qemu/pbrook.git] / tests / tcg / openrisc / test_extx.c
blob09221484a64451669e3918834d3a9b64b1542838
1 #include <stdio.h>
3 int main(void)
5 int a, b;
6 int result;
8 b = 0x83;
9 result = 0xffffff83;
10 __asm
11 ("l.extbs %0, %1\n\t"
12 : "=r"(a)
13 : "r"(b)
15 if (a != result) {
16 printf("extbs error\n");
17 return -1;
20 result = 0x83;
21 __asm
22 ("l.extbz %0, %1\n\t"
23 : "=r"(a)
24 : "r"(b)
26 if (a != result) {
27 printf("extbz error\n");
28 return -1;
31 b = 0x8083;
32 result = 0xffff8083;
33 __asm
34 ("l.exths %0, %1\n\t"
35 : "=r"(a)
36 : "r"(b)
38 if (a != result) {
39 printf("exths error\n");
40 return -1;
43 result = 0x8083;
44 __asm
45 ("l.exthz %0, %1\n\t"
46 : "=r"(a)
47 : "r"(b)
49 if (a != result) {
50 printf("exthz error\n");
51 return -1;
54 b = 0x11;
55 result = 0x11;
56 __asm
57 ("l.extws %0, %1\n\t"
58 : "=r"(a)
59 : "r"(b)
62 if (a != result) {
63 printf("extws error\n");
64 return -1;
67 __asm
68 ("l.extwz %0, %1\n\t"
69 : "=r"(a)
70 : "r"(b)
72 if (a != result) {
73 printf("extwz error\n");
74 return -1;
77 return 0;