1*073d9f2cSAleksandar Markovic #include<stdio.h> 2*073d9f2cSAleksandar Markovic #include<assert.h> 3*073d9f2cSAleksandar Markovic 4*073d9f2cSAleksandar Markovic int main() 5*073d9f2cSAleksandar Markovic { 6*073d9f2cSAleksandar Markovic int rt, rs; 7*073d9f2cSAleksandar Markovic int achi, acli; 8*073d9f2cSAleksandar Markovic int dsp; 9*073d9f2cSAleksandar Markovic int acho, aclo; 10*073d9f2cSAleksandar Markovic int resulth, resultl; 11*073d9f2cSAleksandar Markovic int resdsp; 12*073d9f2cSAleksandar Markovic 13*073d9f2cSAleksandar Markovic achi = 0x00000005; 14*073d9f2cSAleksandar Markovic acli = 0x0000B4CB; 15*073d9f2cSAleksandar Markovic rs = 0x0000FF06; 16*073d9f2cSAleksandar Markovic rt = 0x0000CB00; 17*073d9f2cSAleksandar Markovic resulth = 0x00000005; 18*073d9f2cSAleksandar Markovic resultl = 0x006838CB; 19*073d9f2cSAleksandar Markovic 20*073d9f2cSAleksandar Markovic __asm 21*073d9f2cSAleksandar Markovic ("mthi %2, $ac1\n\t" 22*073d9f2cSAleksandar Markovic "mtlo %3, $ac1\n\t" 23*073d9f2cSAleksandar Markovic "maq_s.w.phr $ac1, %4, %5\n\t" 24*073d9f2cSAleksandar Markovic "mfhi %0, $ac1\n\t" 25*073d9f2cSAleksandar Markovic "mflo %1, $ac1\n\t" 26*073d9f2cSAleksandar Markovic : "=r"(acho), "=r"(aclo) 27*073d9f2cSAleksandar Markovic : "r"(achi), "r"(acli), "r"(rs), "r"(rt) 28*073d9f2cSAleksandar Markovic ); 29*073d9f2cSAleksandar Markovic assert(resulth == acho); 30*073d9f2cSAleksandar Markovic assert(resultl == aclo); 31*073d9f2cSAleksandar Markovic 32*073d9f2cSAleksandar Markovic achi = 0x00000006; 33*073d9f2cSAleksandar Markovic acli = 0x0000B4CB; 34*073d9f2cSAleksandar Markovic rs = 0x00008000; 35*073d9f2cSAleksandar Markovic rt = 0x00008000; 36*073d9f2cSAleksandar Markovic resulth = 0x00000006; 37*073d9f2cSAleksandar Markovic resultl = 0x8000B4CA; 38*073d9f2cSAleksandar Markovic resdsp = 1; 39*073d9f2cSAleksandar Markovic 40*073d9f2cSAleksandar Markovic __asm 41*073d9f2cSAleksandar Markovic ("mthi %3, $ac1\n\t" 42*073d9f2cSAleksandar Markovic "mtlo %4, $ac1\n\t" 43*073d9f2cSAleksandar Markovic "maq_s.w.phr $ac1, %5, %6\n\t" 44*073d9f2cSAleksandar Markovic "mfhi %0, $ac1\n\t" 45*073d9f2cSAleksandar Markovic "mflo %1, $ac1\n\t" 46*073d9f2cSAleksandar Markovic "rddsp %2\n\t" 47*073d9f2cSAleksandar Markovic : "=r"(acho), "=r"(aclo), "=r"(dsp) 48*073d9f2cSAleksandar Markovic : "r"(achi), "r"(acli), "r"(rs), "r"(rt) 49*073d9f2cSAleksandar Markovic ); 50*073d9f2cSAleksandar Markovic assert(resulth == acho); 51*073d9f2cSAleksandar Markovic assert(resultl == aclo); 52*073d9f2cSAleksandar Markovic assert(((dsp >> 17) & 0x01) == resdsp); 53*073d9f2cSAleksandar Markovic 54*073d9f2cSAleksandar Markovic return 0; 55*073d9f2cSAleksandar Markovic } 56