1*d901eff3SJia Liu #include <stdio.h>
2*d901eff3SJia Liu
main(void)3*d901eff3SJia Liu int main(void)
4*d901eff3SJia Liu {
5*d901eff3SJia Liu int a, b, c;
6*d901eff3SJia Liu int result;
7*d901eff3SJia Liu
8*d901eff3SJia Liu a = 0;
9*d901eff3SJia Liu b = 10;
10*d901eff3SJia Liu c = 11;
11*d901eff3SJia Liu result = 0x2;
12*d901eff3SJia Liu __asm
13*d901eff3SJia Liu ("1:\n\t"
14*d901eff3SJia Liu "l.addi %1, %1, 0x01\n\t"
15*d901eff3SJia Liu "l.addi %0, %0, 0x01\n\t"
16*d901eff3SJia Liu "l.sfeq %1, %2\n\t"
17*d901eff3SJia Liu "l.bf 1b\n\t"
18*d901eff3SJia Liu "l.nop\n\t"
19*d901eff3SJia Liu : "+r"(a)
20*d901eff3SJia Liu : "r"(b), "r"(c)
21*d901eff3SJia Liu );
22*d901eff3SJia Liu if (a != result) {
23*d901eff3SJia Liu printf("sfeq error\n");
24*d901eff3SJia Liu return -1;
25*d901eff3SJia Liu }
26*d901eff3SJia Liu
27*d901eff3SJia Liu a = 0x00;
28*d901eff3SJia Liu b = 0x11;
29*d901eff3SJia Liu c = 0x11;
30*d901eff3SJia Liu result = 0x01;
31*d901eff3SJia Liu __asm
32*d901eff3SJia Liu ("1:\n\t"
33*d901eff3SJia Liu "l.addi %1, %1, 0x01\n\t"
34*d901eff3SJia Liu "l.addi %0, %0, 0x01\n\t"
35*d901eff3SJia Liu "l.sfeq %1, %2\n\t"
36*d901eff3SJia Liu "l.bf 1b\n\t"
37*d901eff3SJia Liu "l.nop\n\t"
38*d901eff3SJia Liu : "+r"(a)
39*d901eff3SJia Liu : "r"(b), "r"(c)
40*d901eff3SJia Liu );
41*d901eff3SJia Liu if (a != result) {
42*d901eff3SJia Liu printf("sfeq error\n");
43*d901eff3SJia Liu return -1;
44*d901eff3SJia Liu }
45*d901eff3SJia Liu
46*d901eff3SJia Liu return 0;
47*d901eff3SJia Liu }
48