1
2
3
4
5
6
7
8 #include <asm/reg.h>
9 #include <asm/page.h>
10 #include <asm/mmu.h>
11 #include <asm/pgtable.h>
12 #include <asm/cputable.h>
13 #include <asm/cache.h>
14 #include <asm/thread_info.h>
15 #include <asm/ppc_asm.h>
16 #include <asm/asm-offsets.h>
17
18
19
20
21
22
23
24
25
26
27 #define FPS_ONE_IN(name) \
28 _GLOBAL(fps_ ## name); \
29 lfd 0,0(r3); \
30 MTFSF_L(0); \
31 lfs 0,0(r5); \
32 \
33 name 0,0; \
34 \
35 stfs 0,0(r4); \
36 mffs 0; \
37 stfd 0,0(r3); \
38 blr
39
40
41
42
43
44
45
46
47
48 #define FPS_TWO_IN(name) \
49 _GLOBAL(fps_ ## name); \
50 lfd 0,0(r3); \
51 MTFSF_L(0); \
52 lfs 0,0(r5); \
53 lfs 1,0(r6); \
54 \
55 name 0,0,1; \
56 \
57 stfs 0,0(r4); \
58 mffs 0; \
59 stfd 0,0(r3); \
60 blr
61
62
63
64
65
66
67
68
69
70
71 #define FPS_THREE_IN(name) \
72 _GLOBAL(fps_ ## name); \
73 lfd 0,0(r3); \
74 MTFSF_L(0); \
75 lfs 0,0(r5); \
76 lfs 1,0(r6); \
77 lfs 2,0(r7); \
78 \
79 name 0,0,1,2; \
80 \
81 stfs 0,0(r4); \
82 mffs 0; \
83 stfd 0,0(r3); \
84 blr
85
86 FPS_ONE_IN(fres)
87 FPS_ONE_IN(frsqrte)
88 FPS_ONE_IN(fsqrts)
89 FPS_TWO_IN(fadds)
90 FPS_TWO_IN(fdivs)
91 FPS_TWO_IN(fmuls)
92 FPS_TWO_IN(fsubs)
93 FPS_THREE_IN(fmadds)
94 FPS_THREE_IN(fmsubs)
95 FPS_THREE_IN(fnmadds)
96 FPS_THREE_IN(fnmsubs)
97 FPS_THREE_IN(fsel)
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113 fpd_load_three:
114 lfd 2,0(r8)
115 fpd_load_two:
116 lfd 1,0(r7)
117 fpd_load_one:
118 lfd 0,0(r6)
119 fpd_load_none:
120 lfd 3,0(r3)
121 MTFSF_L(3)
122 lwz r6, 0(r4)
123 mtcr r6
124 blr
125
126
127
128
129
130
131
132
133
134 fpd_return:
135 mfcr r6
136 stfd 0,0(r5)
137 mffs 0
138 stfd 0,0(r3)
139 stw r6,0(r4)
140 blr
141
142
143
144
145
146
147
148
149 #define FPD_NONE_IN(name) \
150 _GLOBAL(fpd_ ## name); \
151 mflr r12; \
152 bl fpd_load_none; \
153 mtlr r12; \
154 \
155 name. 0; \
156 b fpd_return
157
158
159
160
161
162
163
164
165
166 #define FPD_ONE_IN(name) \
167 _GLOBAL(fpd_ ## name); \
168 mflr r12; \
169 bl fpd_load_one; \
170 mtlr r12; \
171 \
172 name. 0,0; \
173 b fpd_return
174
175
176
177
178
179
180
181
182
183
184
185 #define FPD_TWO_IN(name) \
186 _GLOBAL(fpd_ ## name); \
187 mflr r12; \
188 bl fpd_load_two; \
189 mtlr r12; \
190 \
191 name. 0,0,1; \
192 b fpd_return
193
194
195
196
197
198
199
200
201
202
203 #define FPD_TWO_IN_CR(name) \
204 _GLOBAL(fpd_ ## name); \
205 lfd 1,0(r6); \
206 lfd 0,0(r5); \
207 lfd 3,0(r3); \
208 MTFSF_L(3); \
209 lwz r6, 0(r4); \
210 mtcr r6; \
211 \
212 name 0,0,1; \
213 mfcr r6; \
214 mffs 0; \
215 stfd 0,0(r3); \
216 stw r6,0(r4); \
217 blr
218
219
220
221
222
223
224
225
226
227
228
229 #define FPD_THREE_IN(name) \
230 _GLOBAL(fpd_ ## name); \
231 mflr r12; \
232 bl fpd_load_three; \
233 mtlr r12; \
234 \
235 name. 0,0,1,2; \
236 b fpd_return
237
238 FPD_ONE_IN(fsqrts)
239 FPD_ONE_IN(frsqrtes)
240 FPD_ONE_IN(fres)
241 FPD_ONE_IN(frsp)
242 FPD_ONE_IN(fctiw)
243 FPD_ONE_IN(fctiwz)
244 FPD_ONE_IN(fsqrt)
245 FPD_ONE_IN(fre)
246 FPD_ONE_IN(frsqrte)
247 FPD_ONE_IN(fneg)
248 FPD_ONE_IN(fabs)
249 FPD_TWO_IN(fadds)
250 FPD_TWO_IN(fsubs)
251 FPD_TWO_IN(fdivs)
252 FPD_TWO_IN(fmuls)
253 FPD_TWO_IN_CR(fcmpu)
254 FPD_TWO_IN(fcpsgn)
255 FPD_TWO_IN(fdiv)
256 FPD_TWO_IN(fadd)
257 FPD_TWO_IN(fmul)
258 FPD_TWO_IN_CR(fcmpo)
259 FPD_TWO_IN(fsub)
260 FPD_THREE_IN(fmsubs)
261 FPD_THREE_IN(fmadds)
262 FPD_THREE_IN(fnmsubs)
263 FPD_THREE_IN(fnmadds)
264 FPD_THREE_IN(fsel)
265 FPD_THREE_IN(fmsub)
266 FPD_THREE_IN(fmadd)
267 FPD_THREE_IN(fnmsub)
268 FPD_THREE_IN(fnmadd)
269
270 _GLOBAL(kvm_cvt_fd)
271 lfs 0,0(r3)
272 stfd 0,0(r4)
273 blr
274
275 _GLOBAL(kvm_cvt_df)
276 lfd 0,0(r3)
277 stfs 0,0(r4)
278 blr