1#include "io.h" 2 3int main(void) 4{ 5 long long rs, rt, dsp; 6 long long ach = 0, acl = 0; 7 long long resulth, resultl, resultdsp; 8 9 rs = 0x800000FF; 10 rt = 0x80000002; 11 resulth = 0x00; 12 resultl = 0xFFFFFFFF800003FB; 13 resultdsp = 0x01; 14 __asm 15 ("mthi %0, $ac1\n\t" 16 "mtlo %1, $ac1\n\t" 17 "dpaq_s.w.ph $ac1, %3, %4\n\t" 18 "mfhi %0, $ac1\n\t" 19 "mflo %1, $ac1\n\t" 20 "rddsp %2\n\t" 21 : "+r"(ach), "+r"(acl), "=r"(dsp) 22 : "r"(rs), "r"(rt) 23 ); 24 dsp = dsp >> 17 & 0x01; 25 if ((dsp != resultdsp) || (ach != resulth) || (acl != resultl)) { 26 printf("dpaq_w.w.ph wrong\n"); 27 28 return -1; 29 } 30 31 return 0; 32} 33