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