Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: fusl/src/fenv/powerpc/fenv.s

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/fenv/mipsel-sf/fenv.sub ('k') | fusl/src/fenv/sh-nofpu/fenv.sub » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 .global feclearexcept
2 .type feclearexcept,@function
3 feclearexcept:
4 andis. 3,3,0x3e00
5 # if (r3 & FE_INVALID) r3 |= all_invalid_flags
6 andis. 0,3,0x2000
7 stwu 1,-16(1)
8 beq- 0,1f
9 oris 3,3,0x01f8
10 ori 3,3,0x0700
11 1:
12 # note: fpscr contains various fpu status and control
13 # flags and we dont check if r3 may alter other flags
14 # than the exception related ones
15 # fpscr &= ~r3
16 mffs 0
17 stfd 0,8(1)
18 lwz 9,12(1)
19 andc 9,9,3
20 stw 9,12(1)
21 lfd 0,8(1)
22 mtfsf 255,0
23
24 # return 0
25 li 3,0
26 addi 1,1,16
27 blr
28
29 .global feraiseexcept
30 .type feraiseexcept,@function
31 feraiseexcept:
32 andis. 3,3,0x3e00
33 # if (r3 & FE_INVALID) r3 |= software_invalid_flag
34 andis. 0,3,0x2000
35 stwu 1,-16(1)
36 beq- 0,1f
37 ori 3,3,0x0400
38 1:
39 # fpscr |= r3
40 mffs 0
41 stfd 0,8(1)
42 lwz 9,12(1)
43 or 9,9,3
44 stw 9,12(1)
45 lfd 0,8(1)
46 mtfsf 255,0
47
48 # return 0
49 li 3,0
50 addi 1,1,16
51 blr
52
53 .global fetestexcept
54 .type fetestexcept,@function
55 fetestexcept:
56 andis. 3,3,0x3e00
57 # return r3 & fpscr
58 stwu 1,-16(1)
59 mffs 0
60 stfd 0,8(1)
61 lwz 9,12(1)
62 addi 1,1,16
63 and 3,3,9
64 blr
65
66 .global fegetround
67 .type fegetround,@function
68 fegetround:
69 # return fpscr & 3
70 stwu 1,-16(1)
71 mffs 0
72 stfd 0,8(1)
73 lwz 3,12(1)
74 addi 1,1,16
75 clrlwi 3,3,30
76 blr
77
78 .global __fesetround
79 .type __fesetround,@function
80 __fesetround:
81 # note: invalid input is not checked, r3 < 4 must hold
82 # fpscr = (fpscr & -4U) | r3
83 stwu 1,-16(1)
84 mffs 0
85 stfd 0,8(1)
86 lwz 9,12(1)
87 clrrwi 9,9,2
88 or 9,9,3
89 stw 9,12(1)
90 lfd 0,8(1)
91 mtfsf 255,0
92
93 # return 0
94 li 3,0
95 addi 1,1,16
96 blr
97
98 .global fegetenv
99 .type fegetenv,@function
100 fegetenv:
101 # *r3 = fpscr
102 mffs 0
103 stfd 0,0(3)
104 # return 0
105 li 3,0
106 blr
107
108 .global fesetenv
109 .type fesetenv,@function
110 fesetenv:
111 cmpwi 3, -1
112 bne 1f
113 mflr 4
114 bl 2f
115 .zero 8
116 2: mflr 3
117 mtlr 4
118 1: # fpscr = *r3
119 lfd 0,0(3)
120 mtfsf 255,0
121 # return 0
122 li 3,0
123 blr
OLDNEW
« no previous file with comments | « fusl/src/fenv/mipsel-sf/fenv.sub ('k') | fusl/src/fenv/sh-nofpu/fenv.sub » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698