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