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 b = 0x83; 9*d901eff3SJia Liu result = 0xffffff83; 10*d901eff3SJia Liu __asm 11*d901eff3SJia Liu ("l.extbs %0, %1\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("extbs error\n"); 17*d901eff3SJia Liu return -1; 18*d901eff3SJia Liu } 19*d901eff3SJia Liu 20*d901eff3SJia Liu result = 0x83; 21*d901eff3SJia Liu __asm 22*d901eff3SJia Liu ("l.extbz %0, %1\n\t" 23*d901eff3SJia Liu : "=r"(a) 24*d901eff3SJia Liu : "r"(b) 25*d901eff3SJia Liu ); 26*d901eff3SJia Liu if (a != result) { 27*d901eff3SJia Liu printf("extbz error\n"); 28*d901eff3SJia Liu return -1; 29*d901eff3SJia Liu } 30*d901eff3SJia Liu 31*d901eff3SJia Liu b = 0x8083; 32*d901eff3SJia Liu result = 0xffff8083; 33*d901eff3SJia Liu __asm 34*d901eff3SJia Liu ("l.exths %0, %1\n\t" 35*d901eff3SJia Liu : "=r"(a) 36*d901eff3SJia Liu : "r"(b) 37*d901eff3SJia Liu ); 38*d901eff3SJia Liu if (a != result) { 39*d901eff3SJia Liu printf("exths error\n"); 40*d901eff3SJia Liu return -1; 41*d901eff3SJia Liu } 42*d901eff3SJia Liu 43*d901eff3SJia Liu result = 0x8083; 44*d901eff3SJia Liu __asm 45*d901eff3SJia Liu ("l.exthz %0, %1\n\t" 46*d901eff3SJia Liu : "=r"(a) 47*d901eff3SJia Liu : "r"(b) 48*d901eff3SJia Liu ); 49*d901eff3SJia Liu if (a != result) { 50*d901eff3SJia Liu printf("exthz error\n"); 51*d901eff3SJia Liu return -1; 52*d901eff3SJia Liu } 53*d901eff3SJia Liu 54*d901eff3SJia Liu b = 0x11; 55*d901eff3SJia Liu result = 0x11; 56*d901eff3SJia Liu __asm 57*d901eff3SJia Liu ("l.extws %0, %1\n\t" 58*d901eff3SJia Liu : "=r"(a) 59*d901eff3SJia Liu : "r"(b) 60*d901eff3SJia Liu ); 61*d901eff3SJia Liu 62*d901eff3SJia Liu if (a != result) { 63*d901eff3SJia Liu printf("extws error\n"); 64*d901eff3SJia Liu return -1; 65*d901eff3SJia Liu } 66*d901eff3SJia Liu 67*d901eff3SJia Liu __asm 68*d901eff3SJia Liu ("l.extwz %0, %1\n\t" 69*d901eff3SJia Liu : "=r"(a) 70*d901eff3SJia Liu : "r"(b) 71*d901eff3SJia Liu ); 72*d901eff3SJia Liu if (a != result) { 73*d901eff3SJia Liu printf("extwz error\n"); 74*d901eff3SJia Liu return -1; 75*d901eff3SJia Liu } 76*d901eff3SJia Liu 77*d901eff3SJia Liu return 0; 78*d901eff3SJia Liu } 79