1#include<stdio.h> 2#include<assert.h> 3 4int main() 5{ 6 int rs, rt; 7 int result; 8 9 rs = 0x12345678; 10 rt = 0x87654321; 11 result = 0x43215678; 12 13 __asm 14 ("precr_sra_r.ph.w %0, %1, 0x00\n\t" 15 : "+r"(rt) 16 : "r"(rs) 17 ); 18 assert(result == rt); 19 20 rs = 0x12345678; 21 rt = 0x87654321; 22 result = 0xFFFF0000; 23 24 __asm 25 ("precr_sra_r.ph.w %0, %1, 0x1F\n\t" 26 : "+r"(rt) 27 : "r"(rs) 28 ); 29 assert(result == rt); 30 31 return 0; 32} 33