1#include "io.h" 2 3int main(void) 4{ 5 long long rd, rs, rt, result, dspreg, dspresult; 6 rs = 0x123456789ABCDEF0; 7 rt = 0x123456789ABCDEF0; 8 result = 0x0; 9 dspresult = 0x0; 10 11 __asm 12 ("subq_s.qh %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_s.qh error1\n"); 20 21 return -1; 22 } 23 24 rs = 0x4000000080000000; 25 rt = 0x9FFD00009FFC0000; 26 result = 0x7FFF0000E0040000; 27 dspresult = 0x1; 28 29 __asm 30 ("subq_s.qh %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_s.qh error2\n"); 38 39 return -1; 40 } 41 42 rs = 0x8000000000000000; 43 rt = 0x7000000000000000; 44 result = 0x8000000000000000; 45 dspresult = 0x1; 46 __asm 47 ("subq_s.qh %0, %2, %3\n\t" 48 "rddsp %1\n\t" 49 : "=r"(rd), "=r"(dspreg) 50 : "r"(rs), "r"(rt) 51 ); 52 53 dspreg = (dspreg >> 20) & 0x1; 54 if ((rd != result) || (dspreg != dspresult)) { 55 printf("subq_s.qh error3\n"); 56 return -1; 57 } 58 59 return 0; 60} 61 62