1#include<stdio.h> 2#include<assert.h> 3 4int main() 5{ 6 int rd, rs, rt; 7 int dsp; 8 int result; 9 10 rs = 0x11777066; 11 rt = 0x55AA70FF; 12 result = 0x0D; 13 __asm 14 ("cmpgdu.lt.qb %0, %2, %3\n\t" 15 "rddsp %1\n\t" 16 : "=r"(rd), "=r"(dsp) 17 : "r"(rs), "r"(rt) 18 ); 19 dsp = (dsp >> 24) & 0x0F; 20 assert(rd == result); 21 assert(dsp == result); 22 23 rs = 0x11777066; 24 rt = 0x11777066; 25 result = 0x00; 26 __asm 27 ("cmpgdu.lt.qb %0, %2, %3\n\t" 28 "rddsp %1\n\t" 29 : "=r"(rd), "=r"(dsp) 30 : "r"(rs), "r"(rt) 31 ); 32 dsp = (dsp >> 24) & 0x0F; 33 assert(rd == result); 34 assert(dsp == result); 35 36 return 0; 37} 38