test_dsp_r1_subq_ph.c (757B)
1#include<stdio.h> 2#include<assert.h> 3 4int main() 5{ 6 int rd, rs, rt, dsp; 7 int result, resultdsp; 8 9 rs = 0x77777777; 10 rt = 0x67654321; 11 result = 0x10123456; 12 resultdsp = 0x0; 13 14 __asm 15 ("subq.ph %0, %2, %3\n\t" 16 "rddsp %1\n\t" 17 : "=r"(rd), "=r"(dsp) 18 : "r"(rs), "r"(rt) 19 ); 20 dsp = (dsp >> 20) & 0x01; 21 assert(dsp == resultdsp); 22 assert(rd == result); 23 24 rs = 0x12345678; 25 rt = 0x87654321; 26 result = 0x8ACF1357; 27 resultdsp = 0x01; 28 29 __asm 30 ("subq.ph %0, %2, %3\n\t" 31 "rddsp %1\n\t" 32 : "=r"(rd), "=r"(dsp) 33 : "r"(rs), "r"(rt) 34 ); 35 dsp = (dsp >> 20) & 0x01; 36 assert(dsp == resultdsp); 37 assert(rd == result); 38 39 return 0; 40}