floating point environment/exceptions support for mips
[musl] / src / fenv / mips / fenv.s
1 .set noreorder
2
3 .global feclearexcept
4 .type  feclearexcept,@function
5 feclearexcept:
6         cfc1    $5, $31
7         or      $5, $5, $4
8         xor     $5, $5, $4
9         ctc1    $5, $31
10         jr      $ra
11         li      $2, 0
12
13 .global feraiseexcept
14 .type  feraiseexcept,@function
15 feraiseexcept:
16         cfc1    $5, $31
17         or      $5, $5, $4
18         ctc1    $5, $31
19         jr      $ra
20         li      $2, 0
21
22 .global fetestexcept
23 .type  fetestexcept,@function
24 fetestexcept:
25         cfc1    $2, $31
26         jr      $ra
27         and     $2, $2, $4
28
29 .global fegetround
30 .type  fegetround,@function
31 fegetround:
32         cfc1    $2, $31
33         jr      $ra
34         andi    $2, $2, 3
35
36 .global fesetround
37 .type  fesetround,@function
38 fesetround:
39         cfc1    $5, $31
40         li      $6, -4
41         and     $5, $5, $6
42         or      $5, $5, $4
43         jr      $ra
44         li      $2, 0
45
46 .global fegetenv
47 .type  fegetenv,@function
48 fegetenv:
49         cfc1    $5, $31
50         sw      $5, 0($4)
51         jr      $ra
52         li      $2, 0
53
54 .global fesetenv
55 .type  fesetenv,@function
56 fesetenv:
57         lw      $5, 0($4)
58         ctc1    $5, $31
59         jr      $ra
60         li      $2, 0