1#include "io.h" 2 3int main(void) 4{ 5 long long rd, rs, rt, dsp; 6 long long res; 7 8 dsp = 0xff000000; 9 10 rs = 0x1234567812345678; 11 rt = 0x8765432187654321; 12 13 res = 0x1234567812345678; 14 15 __asm 16 ("wrdsp %1, 0x10\n\t" 17 "pick.ob %0, %2, %3\n\t" 18 : "=r"(rd) 19 : "r"(dsp), "r"(rs), "r"(rt) 20 ); 21 22 if (rd != res) { 23 printf("1 pick.ob error\n"); 24 return -1; 25 } 26 27 dsp = 0x00000000; 28 29 rs = 0x1234567812345678; 30 rt = 0x8765432187654321; 31 32 res = 0x8765432187654321; 33 34 __asm 35 ("wrdsp %1, 0x10\n\t" 36 "pick.ob %0, %2, %3\n\t" 37 : "=r"(rd) 38 : "r"(dsp), "r"(rs), "r"(rt) 39 ); 40 41 if (rd != res) { 42 printf("2 pick.ob error\n"); 43 return -1; 44 } 45 46 dsp = 0x34000000; 47 48 rs = 0x1234567812345678; 49 rt = 0x8765432187654321; 50 51 res = 0x8765567887344321; 52 53 __asm 54 ("wrdsp %1, 0x10\n\t" 55 "pick.ob %0, %2, %3\n\t" 56 : "=r"(rd) 57 : "r"(dsp), "r"(rs), "r"(rt) 58 ); 59 60 if (rd != res) { 61 printf("3 pick.ob error\n"); 62 return -1; 63 } 64 65 return 0; 66} 67