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