1 #include <stdio.h> 2 3 #if defined(__mips_hard_float) 4 #define TESTINST_CFC1_CTC1(N) \ 5 { \ 6 unsigned int out = 0; \ 7 __asm__ __volatile__( \ 8 "move $t0, %1" "\n\t" \ 9 "ctc1 $t0, $31" "\n\t" \ 10 "cfc1 $t1, $31" "\n\t" \ 11 "move %0, $t1" "\n\t" \ 12 : "=r" (out) \ 13 : "r" (N) \ 14 : "t0", "t1" \ 15 ); \ 16 printf("out=%d, in=%d\n", out, N); \ 17 } 18 #else 19 #define TESTINST_CFC1_CTC1(N) 20 #endif 21 main()22int main() 23 { 24 int i; 25 printf("--- CTC1, CFC1 ---\n"); 26 for (i = 0; i < 1024; i++) { 27 TESTINST_CFC1_CTC1(i); 28 } 29 30 return 0; 31 } 32