4 ABSS
=0, ABSD
, ADDS
, ADDD
,
5 DIVS
, DIVD
, MULS
, MULD
,
6 NEGS
, NEGD
, SQRTS
, SQRTD
,
7 SUBS
, SUBD
, RECIPS
, RECIPD
,
9 #if (__mips_isa_rev < 6)
10 MSUBS
, MSUBD
, MADDS
, MADDD
,
11 NMADDS
, NMADDD
, NMSUBS
, NMSUBD
16 CEILWS
=0, CEILWD
, FLOORWS
, FLOORWD
,
17 ROUNDWS
, ROUNDWD
, TRUNCWS
, TRUNCWD
,
18 CEILLS
, CEILLD
, FLOORLS
, FLOORLD
,
19 ROUNDLS
, ROUNDLD
, TRUNCLS
, TRUNCLD
23 CVTDS
, CVTDW
, CVTSD
, CVTSW
,
24 CVTWS
, CVTWD
, CVTDL
, CVTLS
,
28 const char *flt_art_op_names
[] = {
29 "abs.s", "abs.d", "add.s", "add.d",
30 "div.s", "div.d", "mul.s", "mul.d",
31 "neg.s", "neg.d", "sqrt.s", "sqrt.d",
32 "sub.s", "sub.d", "recip.s", "recip.d",
33 "rsqrt.s", "rsqrt.d", "msub.s", "msub.d",
34 "madd.s", "madd.d", "nmadd.s", "nmadd.d",
38 const char *flt_dir_op_names
[] = {
39 "ceil.w.s", "ceil.w.d",
40 "floor.w.s", "floor.w.d",
41 "round.w.s", "round.w.d",
42 "trunc.w.s", "trunc.w.d",
43 "ceil.l.s", "ceil.l.d",
44 "floor.l.s", "floor.l.d",
45 "round.l.s", "round.l.d",
46 "trunc.l.s", "trunc.l.d"
49 const char *flt_round_op_names
[] = {
57 #if defined(__mips_hard_float)
60 __asm__ __volatile__( \
62 "cfc1 %0, $31" "\n\t" \
63 : "=r" (fcsr), "=f"(fd_d) \
69 __asm__ __volatile__( \
71 "cfc1 %0, $31" "\n\t" \
72 : "=r" (fcsr), "=f"(fd_f) \
78 __asm__ __volatile__( \
80 "cfc1 %0, $31" "\n\t" \
81 : "=r" (fcsr), "=f"(fd_d) \
87 __asm__ __volatile__( \
89 "cfc1 %0, $31" "\n\t" \
90 : "=r" (fcsr), "=f"(fd_f) \
96 __asm__ __volatile__( \
98 "mfc1 %1, $f0" "\n\t" \
99 "cfc1 %0, $31" "\n\t" \
100 : "=r" (fcsr), "=r"(fd_w) \
107 __asm__ __volatile__( \
108 op" $f0, %2" "\n\t" \
109 "mfc1 %1, $f0" "\n\t" \
110 "cfc1 %0, $31" "\n\t" \
111 : "=r" (fcsr), "=r"(fd_w) \
118 __asm__ __volatile__( \
119 "mtc1 %2, $f0" "\n\t" \
120 op" %1, $f0" "\n\t" \
121 "cfc1 %0, $31" "\n\t" \
122 : "=r" (fcsr), "=f"(fd_d) \
129 __asm__ __volatile__( \
130 "mtc1 %2, $f0" "\n\t" \
131 op" %1, $f0" "\n\t" \
132 "cfc1 %0, $31" "\n\t" \
133 : "=r" (fcsr), "=f"(fd_f) \
140 __asm__ __volatile__( \
141 "dmtc1 %2, $f0" "\n\t" \
142 op" %1, $f0" "\n\t" \
143 "cfc1 %0, $31" "\n\t" \
144 : "=r" (fcsr), "=f"(fd_d) \
151 __asm__ __volatile__( \
152 op" $f0, %2" "\n\t" \
153 "dmfc1 %1, $f0" "\n\t" \
154 "cfc1 %0, $31" "\n\t" \
155 : "=r" (fcsr), "=r"(fd_l) \
162 __asm__ __volatile__( \
163 "dmtc1 %2, $f0" "\n\t" \
164 op" %1, $f0" "\n\t" \
165 "cfc1 %0, $31" "\n\t" \
166 : "=r" (fcsr), "=f"(fd_f) \
173 __asm__ __volatile__( \
174 op" $f0, %2" "\n\t" \
175 "dmfc1 %1, $f0" "\n\t" \
176 "cfc1 %0, $31" "\n\t" \
177 : "=r" (fcsr), "=r"(fd_l) \
184 __asm__ __volatile__( \
185 op" %1, %2, %3" "\n\t" \
186 "cfc1 %0, $31" "\n\t" \
187 : "=r" (fcsr), "=f" (fd_f) \
188 : "f" (fs_f[i]), "f" (ft_f[i]) \
193 __asm__ __volatile__( \
194 op" %1, %2, %3" "\n\t" \
195 "cfc1 %0, $31" "\n\t" \
196 : "=r" (fcsr), "=f"(fd_d) \
197 : "f" (fs_d[i]), "f" (ft_d[i]) \
202 __asm__ __volatile__( \
203 op" %1, %2, %3, %4" "\n\t" \
204 "cfc1 %0, $31" "\n\t" \
205 : "=r" (fcsr), "=f" (fd_f) \
206 : "f" (fr_f[i]), "f" (fs_f[i]) , "f" (ft_f[i]) \
211 __asm__ __volatile__( \
212 op" %1, %2, %3, %4" "\n\t" \
213 "cfc1 %0, $31" "\n\t" \
214 : "=r" (fcsr), "=f"(fd_d) \
215 : "f" (fr_d[i]), "f" (fs_d[i]) , "f" (ft_d[i]) \
218 /* Conditional macros.*/
219 #define TESTINST1s(instruction, RDval) \
222 __asm__ __volatile__( \
223 ".set noreorder" "\n\t" \
224 "mov.s $f1, %1" "\n\t" \
225 "mov.s $f2, %2" "\n\t" \
226 "mtc1 $zero, $f0" "\n\t" \
227 "c.eq.s $f1, $f2" "\n\t" \
228 instruction" end"instruction"s"#RDval "\n\t" \
230 "add.s $f0, $f0, $f1" "\n\t" \
231 "end"instruction"s"#RDval":" "\n\t" \
232 "add.s $f0, $f0, $f2" "\n\t" \
233 "mov.s %0, $f0" "\n\t" \
234 ".set reorder" "\n\t" \
236 : "f" (fs_f[i]) , "f" (ft_f[i]) \
237 : "$f0", "$f1", "$f2" \
239 printf("%s, c.eq.s out=%f, fs=%f, ft=%f\n", \
240 instruction, outf, fs_f[i], ft_f[i]); \
243 #define TESTINST1d(instruction, RDval) \
246 __asm__ __volatile__( \
247 ".set noreorder" "\n\t" \
248 "mov.d $f1, %1" "\n\t" \
249 "mov.d $f2, %2" "\n\t" \
250 "dmtc1 $zero, $f0" "\n\t" \
251 "c.eq.d $f1, $f2" "\n\t" \
252 instruction" end"instruction"d"#RDval "\n\t" \
254 "add.d $f0, $f0, $f1" "\n\t" \
255 "end"instruction"d"#RDval":" "\n\t" \
256 "add.d $f0, $f0, $f2" "\n\t" \
257 "mov.d %0, $f0" "\n\t" \
258 ".set reorder" "\n\t" \
260 : "f" (fs_d[i]) , "f" (ft_d[i]) \
261 : "$f0", "$f1", "$f2" \
263 printf("%s, c.eq.d out=%f, fs=%f, ft=%f\n", \
264 instruction, outd, fs_d[i], ft_d[i]); \
267 #define TESTINST2s(instruction, RDval) \
270 __asm__ __volatile__( \
271 ".set noreorder" "\n\t" \
272 "mov.s $f1, %1" "\n\t" \
273 "mov.s $f2, %2" "\n\t" \
274 "mtc1 $zero, $f0" "\n\t" \
275 "c.eq.s $f1, $f2" "\n\t" \
276 instruction" end"instruction"s"#RDval "\n\t" \
277 "add.s $f0, $f0, $f1" "\n\t" \
278 "end"instruction"s"#RDval":" "\n\t" \
279 "add.s $f0, $f0, $f2" "\n\t" \
280 "mov.s %0, $f0" "\n\t" \
281 ".set reorder" "\n\t" \
283 : "f" (fs_f[i]) , "f" (ft_f[i]) \
284 : "$f0", "$f1", "$f2" \
286 printf("%s, c.eq.s out=%f, fs=%f, ft=%f\n", \
287 instruction, outf, fs_f[i], ft_f[i]); \
290 #define TESTINST2d(instruction, RDval) \
293 __asm__ __volatile__( \
294 ".set noreorder" "\n\t" \
295 "mov.d $f1, %1" "\n\t" \
296 "mov.d $f2, %2" "\n\t" \
297 "dmtc1 $zero, $f0" "\n\t" \
298 "c.eq.d $f1, $f2" "\n\t" \
299 instruction" end"instruction"d"#RDval "\n\t" \
300 "add.d $f0, $f0, $f1" "\n\t" \
301 "end"instruction"d"#RDval":" "\n\t" \
302 "add.d $f0, $f0, $f2" "\n\t" \
303 "mov.d %0, $f0" "\n\t" \
304 ".set reorder" "\n\t" \
306 : "f" (fs_d[i]) , "f" (ft_d[i]) \
307 : "$f0", "$f1", "$f2" \
309 printf("%s, c.eq.d out=%f, fs=%f, ft=%f\n", \
310 instruction, outd, fs_d[i], ft_d[i]); \
313 #define TESTINST_CONDs(instruction, RDval) \
316 __asm__ __volatile__( \
317 ".set noreorder" "\n\t" \
318 "mov.s $f1, %1" "\n\t" \
319 "mov.s $f2, %2" "\n\t" \
320 "mov.s $f0, %1" "\n\t" \
321 instruction" $f1, $f2" "\n\t" \
322 "bc1f end"instruction"s"#RDval "\n\t" \
324 "add.s $f0, $f0, $f2" "\n\t" \
325 "end"instruction"s"#RDval":" "\n\t" \
326 "mov.s %0, $f0" "\n\t" \
327 ".set reorder" "\n\t" \
329 : "f" (fs_f[i]) , "f" (ft_f[i]) \
330 : "$f0", "$f1", "$f2" \
332 printf("%s, bc1f out=%f, fs=%f, ft=%f\n", \
333 instruction, outf, fs_f[i], ft_f[i]); \
336 #define TESTINST_CONDd(instruction, RDval) \
339 __asm__ __volatile__( \
340 ".set noreorder" "\n\t" \
341 "mov.d $f1, %1" "\n\t" \
342 "mov.d $f2, %2" "\n\t" \
343 "mov.d $f0, %1" "\n\t" \
344 instruction" $f1, $f2" "\n\t" \
345 "bc1f end"instruction"d"#RDval "\n\t" \
347 "add.d $f0, $f0, $f2" "\n\t" \
348 "end"instruction"d"#RDval":" "\n\t" \
349 "mov.d %0, $f0" "\n\t" \
350 ".set reorder" "\n\t" \
352 : "f" (fs_d[i]) , "f" (ft_d[i]) \
353 : "$f0", "$f1", "$f2" \
355 printf("%s, bc1f out=%f, fs=%f, ft=%f\n", \
356 instruction, outd, fs_d[i], ft_d[i]); \