1*d901eff3SJia Liu #include <stdio.h> 2*d901eff3SJia Liu main(void)3*d901eff3SJia Liuint 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 = 3; 10*d901eff3SJia Liu result = 1; 11*d901eff3SJia Liu __asm 12*d901eff3SJia Liu ("1:\n\t" 13*d901eff3SJia Liu "l.addi %0, %0, 1\n\t" 14*d901eff3SJia Liu "l.sfges %0, %1\n\t" 15*d901eff3SJia Liu "l.bf 1b\n\t" 16*d901eff3SJia Liu "l.nop\n\t" 17*d901eff3SJia Liu : "+r"(a) 18*d901eff3SJia Liu : "r"(b) 19*d901eff3SJia Liu ); 20*d901eff3SJia Liu if (a != result) { 21*d901eff3SJia Liu printf("sfges error\n"); 22*d901eff3SJia Liu return -1; 23*d901eff3SJia Liu } 24*d901eff3SJia Liu 25*d901eff3SJia Liu a = 0xff; 26*d901eff3SJia Liu b = 3; 27*d901eff3SJia Liu c = 0x1; 28*d901eff3SJia Liu result = 2; 29*d901eff3SJia Liu __asm 30*d901eff3SJia Liu ("1:\n\t" 31*d901eff3SJia Liu "l.sub %0, %0, %2\n\t" 32*d901eff3SJia Liu "l.sfges %0, %1\n\t" 33*d901eff3SJia Liu "l.bf 1b\n\t" 34*d901eff3SJia Liu "l.nop\n\t" 35*d901eff3SJia Liu : "+r"(a) 36*d901eff3SJia Liu : "r"(b), "r"(c) 37*d901eff3SJia Liu ); 38*d901eff3SJia Liu if (a != result) { 39*d901eff3SJia Liu printf("sfges error\n"); 40*d901eff3SJia Liu return -1; 41*d901eff3SJia Liu } 42*d901eff3SJia Liu 43*d901eff3SJia Liu return 0; 44*d901eff3SJia Liu } 45