PPC: Fix rldcl
[qemu/agraf.git] / tests / tcg / openrisc / test_addc.c
blob05d18f8ce5d066ee049d8ddbc19a332948aa0f37
1 #include <stdio.h>
3 int main(void)
5 int a, b, c;
6 int result;
8 b = 0x01;
9 c = 0xffffffff;
10 result = 1;
11 __asm
12 ("l.addc %0, %1, %2\n\t"
13 : "=r"(a)
14 : "r"(b), "r"(c)
16 if (a != result) {
17 printf("first addc error\n");
18 return -1;
21 b = 0x01;
22 c = 0xffffffff;
23 result = 0x80000001;
24 __asm
25 ("l.addc %0, %1, %2\n\t"
26 "l.movhi %2, 0x7fff\n\t"
27 "l.ori %2, %2, 0xffff\n\t"
28 "l.addc %0, %1, %2\n\t"
29 : "=r"(a)
30 : "r"(b), "r"(c)
32 if (a != result) {
33 printf("addc error\n");
34 return -1;
37 return 0;