1#include"io.h" 2 3int main(void) 4{ 5 long long rd, rs, rt; 6 long long result; 7 8 rs = 0x00000010; 9 rt = 0x00000001; 10 result = 0x00000009; 11 12 __asm 13 ("addqh_r.w %0, %1, %2\n\t" 14 : "=r"(rd) 15 : "r"(rs), "r"(rt) 16 ); 17 18 if (rd != result) { 19 printf("addqh_r.w error!\n"); 20 return -1; 21 } 22 rs = 0xFFFFFFFE; 23 rt = 0x00000001; 24 result = 0x00000000; 25 26 __asm 27 ("addqh_r.w %0, %1, %2\n\t" 28 : "=r"(rd) 29 : "r"(rs), "r"(rt) 30 ); 31 32 if (rd != result) { 33 printf("addqh_r.w error!\n"); 34 return -1; 35 } 36 37 return 0; 38} 39