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 b = 0x120; 9*d901eff3SJia Liu c = 0x4; 10*d901eff3SJia Liu result = 0x48; 11*d901eff3SJia Liu 12*d901eff3SJia Liu __asm 13*d901eff3SJia Liu ("l.divu %0, %1, %2\n\t" 14*d901eff3SJia Liu : "=r"(a) 15*d901eff3SJia Liu : "r"(b), "r"(c) 16*d901eff3SJia Liu ); 17*d901eff3SJia Liu if (a != result) { 18*d901eff3SJia Liu printf("divu error\n"); 19*d901eff3SJia Liu return -1; 20*d901eff3SJia Liu } 21*d901eff3SJia Liu 22*d901eff3SJia Liu result = 0x4; 23*d901eff3SJia Liu __asm 24*d901eff3SJia Liu ("l.divu %0, %1, %0\n\t" 25*d901eff3SJia Liu : "+r"(a) 26*d901eff3SJia Liu : "r"(b) 27*d901eff3SJia Liu ); 28*d901eff3SJia Liu if (a != result) { 29*d901eff3SJia Liu printf("divu error\n"); 30*d901eff3SJia Liu return -1; 31*d901eff3SJia Liu } 32*d901eff3SJia Liu 33*d901eff3SJia Liu return 0; 34*d901eff3SJia Liu } 35