1#include<stdio.h> 2#include<assert.h> 3 4int main() 5{ 6 int rd, rt; 7 int result; 8 9 rt = 0x80000000; 10 result = 0x7FFFFFFF; 11 __asm 12 ("absq_s.w %0, %1\n\t" 13 : "=r"(rd) 14 : "r"(rt) 15 ); 16 assert(rd == result); 17 18 rt = 0x80030000; 19 result = 0x7FFD0000; 20 __asm 21 ("absq_s.w %0, %1\n\t" 22 : "=r"(rd) 23 : "r"(rt) 24 ); 25 assert(rd == result); 26 27 rt = 0x31036080; 28 result = 0x31036080; 29 __asm 30 ("absq_s.w %0, %1\n\t" 31 : "=r"(rd) 32 : "r"(rt) 33 ); 34 assert(rd == result); 35 36 return 0; 37} 38