1#include <stdio.h>
2
3int main ()
4{
5   long out [] = {0, 0};
6   __asm__ volatile("cfc1       $a1,   $31"                 "\n\t"
7                    "dli        $t0,   0x405ee0a3d70a3d71"  "\n\t"
8                    "dmtc1      $t0,   $f0"                 "\n\t"
9                    "ctc1       $zero, $31"                 "\n\t"
10                    "round.w.d  $f0,   $f0"                 "\n\t"
11                    "cfc1       $a2,   $31"                 "\n\t"
12                    "sd         $a2,   0(%0)"               "\n\t"
13                    "dli        $t0,   0x3ff0000000000000"  "\n\t"
14                    "dmtc1      $t0,   $f0"                 "\n\t"
15                    "ctc1       $zero, $31"                 "\n\t"
16                    "round.w.d  $f0,   $f0"                 "\n\t"
17                    "cfc1       $a2,   $31"                 "\n\t"
18                    "sd         $a2,   8(%0)"               "\n\t"
19                    "ctc1       $a1,   $31"                 "\n\t"
20                    :
21                    : "r" (out)
22                    : "a1", "a2", "t0", "$f0"
23                   );
24   printf("FCSR::1: 0x%lx, 2: 0x%lx\n", out[0], out[1]);
25   return 0;
26}
27