1#include "io.h" 2 3int main(void) 4{ 5 long long rd, rs, rt, result, dspreg, dspresult; 6 rt = 0x123456789ABCDEF0; 7 rs = 0x123456789ABCDEF0; 8 result = 0x0; 9 dspresult = 0x0; 10 11 __asm 12 ("subq.pw %0, %2, %3\n\t" 13 "rddsp %1\n\t" 14 : "=r"(rd), "=r"(dspreg) 15 : "r"(rs), "r"(rt) 16 ); 17 dspreg = (dspreg >> 20) & 0x1; 18 if ((rd != result) || (dspreg != dspresult)) { 19 printf("subq.pw error1\n\t"); 20 21 return -1; 22 } 23 24 rt = 0x123456789ABCDEF1; 25 rs = 0x123456789ABCDEF2; 26 result = 0x0000000000000001; 27 dspresult = 0x0; 28 29 __asm 30 ("subq.pw %0, %2, %3\n\t" 31 "rddsp %1\n\t" 32 : "=r"(rd), "=r"(dspreg) 33 : "r"(rs), "r"(rt) 34 ); 35 dspreg = (dspreg >> 20) & 0x1; 36 if ((rd != result) || (dspreg != dspresult)) { 37 printf("subq.pw error2\n"); 38 39 return -1; 40 } 41 42 return 0; 43} 44 45