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