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 b = 3; 10*d901eff3SJia Liu result = 4; 11*d901eff3SJia Liu __asm 12*d901eff3SJia Liu ("1:\n\t" 13*d901eff3SJia Liu "l.addi %0, %0, 4\n\t" 14*d901eff3SJia Liu "l.sflts %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("sflts error\n"); 22*d901eff3SJia Liu return -1; 23*d901eff3SJia Liu } 24*d901eff3SJia Liu 25*d901eff3SJia Liu a = 0; 26*d901eff3SJia Liu b = 3; 27*d901eff3SJia Liu result = 3; 28*d901eff3SJia Liu __asm 29*d901eff3SJia Liu ("1:\n\t" 30*d901eff3SJia Liu "l.addi %0, %0, 1\n\t" 31*d901eff3SJia Liu "l.sflts %0, %1\n\t" 32*d901eff3SJia Liu "l.bf 1b\n\t" 33*d901eff3SJia Liu "l.nop\n\t" 34*d901eff3SJia Liu : "+r"(a) 35*d901eff3SJia Liu : "r"(b) 36*d901eff3SJia Liu ); 37*d901eff3SJia Liu if (a != result) { 38*d901eff3SJia Liu printf("sflts error\n"); 39*d901eff3SJia Liu return -1; 40*d901eff3SJia Liu } 41*d901eff3SJia Liu 42*d901eff3SJia Liu return 0; 43*d901eff3SJia Liu } 44