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