test_divu.c (474B)
1#include <stdio.h> 2 3int main(void) 4{ 5 int a, b, c; 6 int result; 7 8 b = 0x120; 9 c = 0x4; 10 result = 0x48; 11 12 __asm 13 ("l.divu %0, %1, %2\n\t" 14 : "=r"(a) 15 : "r"(b), "r"(c) 16 ); 17 if (a != result) { 18 printf("divu error\n"); 19 return -1; 20 } 21 22 result = 0x4; 23 __asm 24 ("l.divu %0, %1, %0\n\t" 25 : "+r"(a) 26 : "r"(b) 27 ); 28 if (a != result) { 29 printf("divu error\n"); 30 return -1; 31 } 32 33 return 0; 34}