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 = 0x4; 9*d901eff3SJia Liu c = 0x1; 10*d901eff3SJia Liu result = 0x4; 11*d901eff3SJia Liu __asm 12*d901eff3SJia Liu ("l.muli %0, %1, 0x1\n\t" 13*d901eff3SJia Liu : "=r"(a) 14*d901eff3SJia Liu : "r"(b) 15*d901eff3SJia Liu ); 16*d901eff3SJia Liu if (a != result) { 17*d901eff3SJia Liu printf("muli error\n"); 18*d901eff3SJia Liu return -1; 19*d901eff3SJia Liu } 20*d901eff3SJia Liu 21*d901eff3SJia Liu b = 0x1; 22*d901eff3SJia Liu c = 0x0; 23*d901eff3SJia Liu result = 0x0; 24*d901eff3SJia Liu __asm 25*d901eff3SJia Liu ("l.muli %0, %1, 0x0\n\t" 26*d901eff3SJia Liu : "=r"(a) 27*d901eff3SJia Liu : "r"(b) 28*d901eff3SJia Liu ); 29*d901eff3SJia Liu if (a != result) { 30*d901eff3SJia Liu printf("muli error\n"); 31*d901eff3SJia Liu return -1; 32*d901eff3SJia Liu } 33*d901eff3SJia Liu 34*d901eff3SJia Liu b = 0x1; 35*d901eff3SJia Liu c = 0xff; 36*d901eff3SJia Liu result = 0xff; 37*d901eff3SJia Liu __asm 38*d901eff3SJia Liu ("l.muli %0, %1, 0xff\n\t" 39*d901eff3SJia Liu : "=r"(a) 40*d901eff3SJia Liu : "r"(b) 41*d901eff3SJia Liu ); 42*d901eff3SJia Liu if (a != result) { 43*d901eff3SJia Liu printf("muli error\n"); 44*d901eff3SJia Liu return -1; 45*d901eff3SJia Liu } 46*d901eff3SJia Liu 47*d901eff3SJia Liu return 0; 48*d901eff3SJia Liu } 49