Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: fp_muldiv0_n2.s | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #define H_T0_Fp_exception_ieee_754_0x21 T0_Fp_exception_ieee_754 | |
39 | #define H_T0_Fp_exception_other_0x22 T0_Fp_exception_other | |
40 | ||
41 | #define H_HT0_Illegal_instruction_0x10 T0_Fp_unimplemented | |
42 | ||
43 | #define ENABLE_T0_Fp_disabled_0x20 | |
44 | #define MAIN_PAGE_HV_ALSO | |
45 | #define MAIN_PAGE_NUCLEUS_ALSO | |
46 | #include "hboot.s" | |
47 | ||
48 | .global sam_fast_immu_miss | |
49 | .global sam_fast_dmmu_miss | |
50 | ||
51 | .text | |
52 | .global main | |
53 | ||
54 | main: | |
55 | ||
56 | wr %g0, 0x4, %fprs /* make sure fef is 1 */ | |
57 | ||
58 | setx fsr_tem_en, %l0, %l3 ! fsr tem enable value | |
59 | ||
60 | /******************************************************* | |
61 | * Simple data | |
62 | *******************************************************/ | |
63 | ||
64 | ! By default, mask is disabled | |
65 | ||
66 | ld [%l3+0x0], %fsr ! Read it from memory - trap disabled | |
67 | ||
68 | /* Basic fp add and sub */ | |
69 | ||
70 | ! ones and 0s | |
71 | ||
72 | setx data1, %l0, %l2 ! Some data | |
73 | ||
74 | ld [%l2+0x0], %f0 ! 1.0 | |
75 | ld [%l2+0x4], %f2 ! 0.0 | |
76 | ld [%l2+0x8], %f4 ! -1.0 | |
77 | ld [%l2+0xc], %f6 ! -0.0 | |
78 | ||
79 | fmuls %f0, %f0, %f1 | |
80 | fmuls %f0, %f2, %f3 | |
81 | fmuls %f0, %f4, %f5 | |
82 | fmuls %f0, %f6, %f10 | |
83 | fsmuld %f0, %f0, %f10 | |
84 | fsmuld %f0, %f2, %f10 | |
85 | fsmuld %f0, %f4, %f10 | |
86 | fsmuld %f0, %f6, %f10 | |
87 | fdivs %f0, %f0, %f12 | |
88 | fdivs %f0, %f2, %f14 | |
89 | fdivs %f0, %f3, %f16 | |
90 | fdivs %f0, %f6, %f18 | |
91 | fdivs %f2, %f0, %f20 | |
92 | fdivs %f2, %f4, %f22 | |
93 | fdivs %f2, %f6, %f24 | |
94 | fdivs %f4, %f0, %f26 | |
95 | fdivs %f4, %f2, %f28 | |
96 | fdivs %f4, %f6, %f30 | |
97 | fdivs %f6, %f0, %f27 | |
98 | fdivs %f6, %f2, %f29 | |
99 | fdivs %f6, %f4, %f31 | |
100 | ||
101 | setx ddata1, %l0, %l2 ! Double precision boundaries | |
102 | ||
103 | ldd [%l2+0x0], %f0 ! 1.0 | |
104 | ldd [%l2+0x8], %f2 ! 0.0 | |
105 | ldd [%l2+0x10], %f4 ! -1.0 | |
106 | ldd [%l2+0x18], %f6 ! -0.0 | |
107 | ||
108 | fmuld %f0, %f0, %f32 | |
109 | fmuld %f0, %f2, %f34 | |
110 | fmuld %f0, %f4, %f36 | |
111 | fmuld %f0, %f6, %f10 | |
112 | fdivd %f0, %f0, %f12 | |
113 | fdivd %f0, %f2, %f14 | |
114 | fdivd %f0, %f4, %f16 | |
115 | fdivd %f0, %f6, %f18 | |
116 | fdivd %f2, %f0, %f20 | |
117 | fdivd %f2, %f4, %f22 | |
118 | fdivd %f2, %f6, %f24 | |
119 | fdivd %f4, %f0, %f26 | |
120 | fdivd %f4, %f2, %f28 | |
121 | fdivd %f4, %f6, %f30 | |
122 | fdivd %f6, %f0, %f38 | |
123 | fdivd %f6, %f2, %f40 | |
124 | fdivd %f6, %f4, %f42 | |
125 | ||
126 | fmulq %f0, %f0, %f0 ! This should cause - unimplemented fpop | |
127 | fdmulq %f0, %f0, %f0 ! This should cause - unimplemented fpop | |
128 | fdivq %f0, %f0, %f0 | |
129 | ||
130 | ! -ve OF | |
131 | ||
132 | setx sp_n_u_normal, %l0, %l4 ! Largest -ve normal number | |
133 | setx sp_p_u_normal, %l0, %l6 ! Largest +ve normal number | |
134 | ||
135 | ld [%l4+0x0], %f0 ! | |
136 | ld [%l6+0x0], %f4 ! | |
137 | fdivs %f0, %f4, %f6 ! Should result in negative overflow | |
138 | ||
139 | ! +ve UF (Not successful in generating UF) (??) | |
140 | ||
141 | setx sp_p_denormal_0, %l0, %l4 ! Small +ve normal number | |
142 | setx sp_p_l_denormal, %l0, %l6 ! Smallest +ve normal number | |
143 | ||
144 | ld [%l4+0x0], %f0 ! | |
145 | ld [%l6+0x0], %f4 ! | |
146 | fdivs %f4, %f0, %f8 ! Should result in negative underflow | |
147 | ||
148 | ! Go thru normals and denormals - only adjacent mul/div | |
149 | ||
150 | setx data1_denorm, %l0, %l4 ! sp | |
151 | setx ddata1_denorm, %l0, %l6 ! dp | |
152 | ||
153 | set 0x4, %g6 ! Max loop count rd | |
154 | set 0x30, %g1 ! Max loop count | |
155 | ||
156 | set 0x0, %g7 ! loop iterator | |
157 | ||
158 | fmuldiv_rd_loop0: ! Rounding mode loop | |
159 | ||
160 | sll %g7, 0x2, %g5 ! Align address | |
161 | ld [%l3+%g5], %fsr ! Read it from memory - trap disabled | |
162 | ||
163 | set 0x0, %g2 ! inner loop iterator | |
164 | ||
165 | fmuldiv_loop0: | |
166 | ||
167 | sll %g2, 0x2, %g3 ! Align address | |
168 | sll %g2, 0x3, %g4 ! Align address | |
169 | ||
170 | ld [%l4+%g3], %f0 ! single precision | |
171 | ldd [%l6+%g4], %f2 ! double precision | |
172 | ||
173 | add %g3, 0x4, %g3 | |
174 | add %g4, 0x8, %g4 | |
175 | ||
176 | ld [%l4+%g3], %f4 ! single precision | |
177 | ldd [%l6+%g4], %f6 ! double precision | |
178 | ||
179 | fmuls %f0, %f4, %f10 | |
180 | fmuls %f4, %f0, %f12 | |
181 | fsmuld %f0, %f4, %f18 | |
182 | fsmuld %f4, %f0, %f20 | |
183 | fdivs %f0, %f4, %f14 | |
184 | fdivs %f4, %f0, %f16 | |
185 | ||
186 | fmuld %f2, %f6, %f20 | |
187 | fmuld %f6, %f2, %f22 | |
188 | fdivd %f2, %f6, %f24 | |
189 | fdivd %f6, %f2, %f26 | |
190 | ||
191 | add %g2, 0x1, %g2 | |
192 | subcc %g2, %g1, %g0 | |
193 | ||
194 | bne,a fmuldiv_loop0 ! If not 0, go to test more | |
195 | nop | |
196 | ||
197 | add %g7, 0x1, %g7 | |
198 | subcc %g7, %g6, %g0 | |
199 | ||
200 | bne,a fmuldiv_rd_loop0 ! If not 0, go to test more | |
201 | nop | |
202 | ||
203 | ||
204 | ||
205 | ! Go thru loop that covers all the NaN cases | |
206 | ||
207 | setx fsr_tem_dis, %l0, %l3 ! fsr tem enable value | |
208 | ||
209 | setx data0, %l0, %l4 ! sp | |
210 | setx ddata0, %l0, %l6 ! dp | |
211 | ||
212 | set 0x4, %g6 ! Max loop count rd | |
213 | set 0x17, %g1 ! Max loop count | |
214 | ||
215 | set 0x0, %g7 ! loop iterator | |
216 | ||
217 | fmuldiv_rd_loop1: ! Rounding mode loop | |
218 | ||
219 | sll %g7, 0x2, %g5 ! Align address | |
220 | ld [%l3+%g5], %fsr ! Read it from memory - trap disabled | |
221 | ||
222 | set 0x0, %l7 ! outer loop iterator - l7 is not used | |
223 | ||
224 | fmuldiv_out_loop1: | |
225 | ||
226 | set 0x0, %g2 ! inner loop iterator | |
227 | ||
228 | fmuldiv_in_loop1: | |
229 | ||
230 | ld [%l3+%g5], %fsr ! Read it from memory - trap disabled | |
231 | ||
232 | sll %g2, 0x2, %g3 ! Align address | |
233 | sll %g2, 0x3, %g4 ! Align address | |
234 | ||
235 | ld [%l4+%g3], %f0 ! single precision | |
236 | ldd [%l6+%g4], %f2 ! double precision | |
237 | ||
238 | sll %l7, 0x2, %g3 ! Align address | |
239 | sll %l7, 0x3, %g4 ! Align address | |
240 | ||
241 | ld [%l4+%g3], %f4 ! single precision | |
242 | ldd [%l6+%g4], %f6 ! double precision | |
243 | ||
244 | fmuls %f0, %f4, %f10 | |
245 | fsmuld %f0, %f4, %f18 | |
246 | fdivs %f0, %f4, %f14 | |
247 | ||
248 | fmuld %f2, %f6, %f20 | |
249 | fdivd %f2, %f6, %f24 | |
250 | ||
251 | add %g2, 0x1, %g2 | |
252 | subcc %g2, %g1, %g0 | |
253 | ||
254 | bne,a fmuldiv_in_loop1 ! If not 0, go to test more | |
255 | nop | |
256 | ||
257 | add %l7, 0x1, %l7 | |
258 | subcc %l7, %g1, %g0 | |
259 | ||
260 | bne,a fmuldiv_out_loop1 ! If not 0, go to test more | |
261 | nop | |
262 | ||
263 | add %g7, 0x1, %g7 | |
264 | subcc %g7, %g6, %g0 | |
265 | ||
266 | bne,a fmuldiv_rd_loop1 ! If not 0, go to test more | |
267 | nop | |
268 | ||
269 | /******************************************************* | |
270 | * Exit code | |
271 | *******************************************************/ | |
272 | ||
273 | test_pass: | |
274 | ta T_GOOD_TRAP | |
275 | ||
276 | test_fail: | |
277 | ta T_BAD_TRAP | |
278 | ||
279 | /******************************************************* | |
280 | * Data section | |
281 | *******************************************************/ | |
282 | ||
283 | .data | |
284 | ||
285 | data0: | |
286 | sp_n_u_quiet_nan: | |
287 | .word 0xffffffff ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
288 | sp_n_l_quiet_nan: | |
289 | .word 0xffc00001 ! -NaN (Quiet) (S = 1, E = 255, F > 0) 04 | |
290 | sp_n_ind_nan: | |
291 | .word 0xffc00000 ! -NaN (Indeterminate) (S = 1, E = 255, F > 0) 08 | |
292 | sp_n_u_signaling_nan: | |
293 | .word 0xffbfffff ! -NaN (Signaling) (S = 1, E = 255, F > 0) 0c | |
294 | sp_n_l_signaling_nan: | |
295 | .word 0xff800001 ! -NaN (Signaling) (S = 1, E = 255, F > 0) 10 | |
296 | sp_n_inf: | |
297 | .word 0xff800000 ! -ve Infinity (ovf) (S = 1, E = 255, F = 0) 14 | |
298 | sp_n_u_normal: | |
299 | .word 0xff7fffff ! -ve normalized (S = 1, 0 < E < 255) 18 | |
300 | sp_n_l_normal: | |
301 | .word 0x80800000 ! -ve normalized (S = 1, 0 < E < 255) 1c | |
302 | sp_n_u_denormal: | |
303 | .word 0x807fffff ! -ve denormalized (S = 1, E=0, F is non-zero) 20 | |
304 | sp_n_l_denormal: | |
305 | .word 0x80000001 ! -ve denormalized (S = 1, E=0, F is non-zero) 24 | |
306 | sp_n_uf: | |
307 | .word 0x80000000 ! -ve Underflow (S = 1, E=0, F = 0) 28 | |
308 | sp_n_0: | |
309 | .word 0x80000000 ! -ve 0 (S = 1, E=0, F = 0) 2c | |
310 | sp_p_0: | |
311 | .word 0x00000000 ! +ve 0 (S = 0, E=0, F = 0) 30 | |
312 | sp_p_uf: | |
313 | .word 0x00000000 ! +ve Underflow (S = 0, E=0, F = 0) 34 | |
314 | sp_p_l_denormal: | |
315 | .word 0x00000001 ! +ve denormalized (S = 0, E=0, F is non-zero) 38 | |
316 | sp_p_u_denormal: | |
317 | .word 0x007fffff ! +ve denormalized (S = 0, E=0, F is non-zero) 3c | |
318 | sp_p_l_normal: | |
319 | .word 0x00800000 ! +ve normalized (S = 0, 0 < E < 255) 40 | |
320 | sp_p_u_normal: | |
321 | .word 0x7f7fffff ! +ve normalized (S = 0, 0 < E < 255) 44 | |
322 | sp_p_inf: | |
323 | .word 0x7f800000 ! +ve Infinity (ovf) (S = 0, E = 255, F = 0) 48 | |
324 | sp_p_l_signaling_nan: | |
325 | .word 0x7f800001 ! +NaN (Signaling) (S = 0, E = 255, F > 0) 4c | |
326 | sp_p_u_signaling_nan: | |
327 | .word 0x7fbfffff ! +NaN (Signaling) (S = 0, E = 255, F > 0) 50 | |
328 | sp_p_l_quiet_nan: | |
329 | .word 0x7fc00000 ! +NaN (Quiet) (S = 0, E = 255, F > 0) 54 | |
330 | sp_p_u_quiet_nan: | |
331 | .word 0x7fffffff ! +NaN (Quiet) (S = 0, E = 255, F > 0) 5c | |
332 | ||
333 | sp_n_quiet_nan_0: | |
334 | .word 0xffefffff ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
335 | sp_n_quiet_nan_1: | |
336 | .word 0xffc00002 ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
337 | sp_p_quiet_nan_0: | |
338 | .word 0x7fefffff ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
339 | sp_p_quiet_nan_1: | |
340 | .word 0x7fc00002 ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
341 | ||
342 | sp_n_signaling_nan_0: | |
343 | .word 0xffa00000 ! -NaN (Signaling) (S = 1, E = 255, F > 0) 0c | |
344 | sp_p_signaling_nan_0: | |
345 | .word 0x7fa00000 ! -NaN (Signaling) (S = 1, E = 255, F > 0) 0c | |
346 | ||
347 | sp_p_normal_0: | |
348 | .word 0x00800001 ! +ve normalized (S = 0, 0 < E < 255) 40 | |
349 | sp_p_denormal_0: | |
350 | .word 0x00000002 ! +ve denormalized (S = 0, E=0, F is non-zero) 38 | |
351 | ||
352 | .align 256 | |
353 | ||
354 | ddata0: | |
355 | dp_n_u_quiet_nan: | |
356 | .xword 0xffffffffffffffff ! -NaN (Quiet) (S = 1, E = 2047, F > 0) 00 | |
357 | dp_n_l_quiet_nan: | |
358 | .xword 0xfff8000000000001 ! -NaN (Quiet) (S = 1, E = 2047, F > 0) 04 | |
359 | dp_n_ind_nan: | |
360 | .xword 0xfff8000000000000 ! -NaN (Indeterminate) (S = 1, E = 2047, F > 0) 08 | |
361 | dp_n_u_signaling_nan: | |
362 | .xword 0xfff7ffffffffffff ! -NaN (Signaling) (S = 1, E = 2047, F > 0) 0c | |
363 | dp_n_l_signaling_nan: | |
364 | .xword 0xfff0000000000001 ! -NaN (Signaling) (S = 1, E = 2047, F > 0) 10 | |
365 | dp_n_inf: | |
366 | .xword 0xfff0000000000000 ! -ve Infinity (ovf) (S = 1, E = 2047, F = 0) 14 | |
367 | dp_n_u_normal: | |
368 | .xword 0xffefffffffffffff ! -ve normalized (S = 1, 0 < E < 2047) 18 | |
369 | dp_n_l_normal: | |
370 | .xword 0x8010000000000000 ! -ve normalized (S = 1, 0 < E < 2047) 1c | |
371 | dp_n_u_denormal: | |
372 | .xword 0x800fffffffffffff ! -ve denormalized (S = 1, E=0, F is non-zero) 20 | |
373 | dp_n_l_denormal: | |
374 | .xword 0x8000000000000001 ! -ve denormalized (S = 1, E=0, F is non-zero) 24 | |
375 | dp_n_uf: | |
376 | .xword 0x8000000000000000 ! -ve Underflow (S = 1, E=0, F = 0) 28 | |
377 | dp_n_0: | |
378 | .xword 0x8000000000000000 ! -ve 0 (S = 1, E=0, F = 0) 2c | |
379 | dp_p_0: | |
380 | .xword 0x0000000000000000 ! +ve 0 (S = 0, E=0, F = 0) 30 | |
381 | dp_p_uf: | |
382 | .xword 0x0000000000000000 ! +ve Underflow (S = 0, E=0, F = 0) 34 | |
383 | dp_p_l_denormal: | |
384 | .xword 0x0000000000000001 ! +ve denormalized (S = 0, E=0, F is non-zero) 38 | |
385 | dp_p_u_denormal: | |
386 | .xword 0x000fffffffffffff ! +ve denormalized (S = 0, E=0, F is non-zero) 3c | |
387 | dp_p_l_normal: | |
388 | .xword 0x0010000000000000 ! +ve normalized (S = 0, 0 < E < 2047) 40 | |
389 | dp_p_u_normal: | |
390 | .xword 0x7fefffffffffffff ! +ve normalized (S = 0, 0 < E < 2047) 44 | |
391 | dp_p_inf: | |
392 | .xword 0x7ff0000000000000 ! +ve Infinity (ovf) (S = 0, E = 2047, F = 0) 48 | |
393 | dp_p_l_signaling_nan: | |
394 | .xword 0x7ff0000000000001 ! +NaN (Signaling) (S = 0, E = 2047, F > 0) 4c | |
395 | dp_p_u_signaling_nan: | |
396 | .xword 0x7ff7ffffffffffff ! +NaN (Signaling) (S = 0, E = 2047, F > 0) 50 | |
397 | dp_p_l_quiet_nan: | |
398 | .xword 0x7ff8000000000000 ! +NaN (Quiet) (S = 0, E = 2047, F > 0) 54 | |
399 | dp_p_u_quiet_nan: | |
400 | .xword 0x7fffffffffffffff ! +NaN (Quiet) (S = 0, E = 2047, F > 0) 5c | |
401 | ||
402 | dp_n_quiet_nan_0: | |
403 | .xword 0xfffeffffffffffff ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
404 | dp_n_quiet_nan_1: | |
405 | .xword 0xfff8000000000002 ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
406 | dp_p_quiet_nan_0: | |
407 | .xword 0x7ffeffffffffffff ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
408 | dp_p_quiet_nan_1: | |
409 | .xword 0x7ff8000000000002 ! -NaN (Quiet) (S = 1, E = 255, F > 0) 00 | |
410 | ||
411 | dp_n_signaling_nan_0: | |
412 | .xword 0xfff4000000000000 ! -NaN (Signaling) (S = 1, E = 255, F > 0) 0c | |
413 | dp_p_signaling_nan_0: | |
414 | .xword 0x7ff4000000000000 ! -NaN (Signaling) (S = 1, E = 255, F > 0) 0c | |
415 | ||
416 | .align 256 | |
417 | ||
418 | data1: | |
419 | .word 0x3f800000 ! 1.0 0x0 | |
420 | .word 0x00000000 ! 0.0 0x4 | |
421 | .word 0xbf800000 ! -1.0 0x8 | |
422 | .word 0x80000000 ! -0.0 0xc | |
423 | ||
424 | .word 0x4f000000 ! Large positive number should cause NV on conversion 0x10 | |
425 | .word 0xcf000000 ! Large negative number should cause NV on conversion 0x14 | |
426 | ||
427 | .word 0x5f0ac723 ! Large positive number should cause NV on conversion 0x18 | |
428 | .word 0xdf0ac723 ! Large negative number should cause NV on conversion 0x1c | |
429 | ||
430 | data1_denorm: | |
431 | ||
432 | .word 0x807fffff ! Denormal number -ve | |
433 | .word 0x80700000 ! Denormal number -ve | |
434 | .word 0x803fffff ! Denormal number -ve | |
435 | .word 0x80400000 ! Denormal number -ve | |
436 | .word 0x80400001 ! Denormal number -ve | |
437 | .word 0x80000001 ! Denormal number -ve | |
438 | .word 0x80000001 ! Denormal number -ve | |
439 | .word 0x007fffff ! Denormal number +ve | |
440 | .word 0x007fffff ! Denormal number +ve | |
441 | .word 0x00700000 ! Denormal number +ve | |
442 | .word 0x003fffff ! Denormal number +ve | |
443 | .word 0x00400000 ! Denormal number +ve | |
444 | .word 0x00400001 ! Denormal number +ve | |
445 | .word 0x00000001 ! Denormal number +ve | |
446 | ||
447 | data1_norm: | |
448 | ||
449 | .word 0xff7fffff ! Normal | |
450 | .word 0xff700000 ! Normal | |
451 | .word 0xff7ffffe ! Normal | |
452 | .word 0xff7aaaaa ! Normal | |
453 | .word 0xff755555 ! Normal | |
454 | .word 0xfe7fffff ! Normal | |
455 | .word 0xfe700000 ! Normal | |
456 | .word 0xfe7ffffe ! Normal | |
457 | .word 0xfe7aaaaa ! Normal | |
458 | .word 0xfe755555 ! Normal | |
459 | .word 0x80ffffff ! Normal | |
460 | .word 0x80f00000 ! Normal | |
461 | .word 0x80c00001 ! Normal | |
462 | .word 0x80c00000 ! Normal | |
463 | .word 0x80800001 ! Normal | |
464 | .word 0x80800000 ! Normal | |
465 | .word 0x80800000 ! Normal | |
466 | .word 0x00800000 ! Normal | |
467 | .word 0x00800000 ! Normal | |
468 | .word 0x00800001 ! Normal | |
469 | .word 0x00c00000 ! Normal | |
470 | .word 0x00c00001 ! Normal | |
471 | .word 0x00f00000 ! Normal | |
472 | .word 0x00ffffff ! Normal | |
473 | .word 0x7e755555 ! Normal | |
474 | .word 0x7e7aaaaa ! Normal | |
475 | .word 0x7e7ffffe ! Normal | |
476 | .word 0x7e700000 ! Normal | |
477 | .word 0x7e7fffff ! Normal | |
478 | .word 0x7f755555 ! Normal | |
479 | .word 0x7f7aaaaa ! Normal | |
480 | .word 0x7f7ffffe ! Normal | |
481 | .word 0x7f700000 ! Normal | |
482 | .word 0x7f7fffff ! Normal | |
483 | ||
484 | .align 256 | |
485 | ||
486 | ddata1: | |
487 | .xword 0x3ff0000000000000 ! 1.0 0x0 | |
488 | .xword 0x0000000000000000 ! 0.0 0x8 | |
489 | .xword 0xbff0000000000000 ! -1.0 0x10 | |
490 | .xword 0x8000000000000000 ! -0.0 0x18 | |
491 | ||
492 | .xword 0x41e0000000000000 ! Large positive number should cause NV on conversion 0x20 | |
493 | .xword 0xc1e0000000000000 ! Large negative number should cause NV on conversion 0x28 | |
494 | ||
495 | .xword 0x43e158e460913d00 ! Large positive number should cause NV on conversion to int 0x30 | |
496 | .xword 0xc3e158e460913d00 ! Large negative number should cause NV on conversion to int 0x38 | |
497 | ||
498 | ddata1_denorm: | |
499 | ||
500 | .xword 0x800fffffffffffff ! Denormal number -ve | |
501 | .xword 0x800f000000000000 ! Denormal number -ve | |
502 | .xword 0x8007ffffffffffff ! Denormal number -ve | |
503 | .xword 0x8008000000000000 ! Denormal number -ve | |
504 | .xword 0x8008000000000001 ! Denormal number -ve | |
505 | .xword 0x8000000000000001 ! Denormal number -ve | |
506 | .xword 0x8000000000000001 ! Denormal number -ve | |
507 | .xword 0x000fffffffffffff ! Denormal number +ve | |
508 | .xword 0x000fffffffffffff ! Denormal number +ve | |
509 | .xword 0x000f000000000000 ! Denormal number +ve | |
510 | .xword 0x0007ffffffffffff ! Denormal number +ve | |
511 | .xword 0x0008000000000000 ! Denormal number +ve | |
512 | .xword 0x0008000000000001 ! Denormal number +ve | |
513 | .xword 0x0000000000000001 ! Denormal number +ve | |
514 | ||
515 | ddata1_norm: | |
516 | ||
517 | .xword 0xffefffffffffffff ! Normal | |
518 | .xword 0xffef000000000000 ! Normal | |
519 | .xword 0xffeffffffffffffe ! Normal | |
520 | .xword 0xffeaaaaaaaaaaaaa ! Normal | |
521 | .xword 0xffe5555555555555 ! Normal | |
522 | .xword 0xffcfffffffffffff ! Normal | |
523 | .xword 0xffcf000000000000 ! Normal | |
524 | .xword 0xffcffffffffffffe ! Normal | |
525 | .xword 0xffcaaaaaaaaaaaaa ! Normal | |
526 | .xword 0xffc5555555555555 ! Normal | |
527 | .xword 0x801fffffffffffff ! Normal | |
528 | .xword 0x801f000000000000 ! Normal | |
529 | .xword 0x8018000000000001 ! Normal | |
530 | .xword 0x8018000000000000 ! Normal | |
531 | .xword 0x8010000000000001 ! Normal | |
532 | .xword 0x8010000000000000 ! Normal | |
533 | .xword 0x8010000000000000 ! Normal | |
534 | .xword 0x0010000000000000 ! Normal | |
535 | .xword 0x0010000000000000 ! Normal | |
536 | .xword 0x0010000000000001 ! Normal | |
537 | .xword 0x0018000000000000 ! Normal | |
538 | .xword 0x0018000000000001 ! Normal | |
539 | .xword 0x001f000000000000 ! Normal | |
540 | .xword 0x001fffffffffffff ! Normal | |
541 | .xword 0x7fc5555555555555 ! Normal | |
542 | .xword 0x7fcaaaaaaaaaaaaa ! Normal | |
543 | .xword 0x7fcffffffffffffe ! Normal | |
544 | .xword 0x7fc7000000000000 ! Normal | |
545 | .xword 0x7fc7ffffffffffff ! Normal | |
546 | .xword 0x7fe5555555555555 ! Normal | |
547 | .xword 0x7fe5aaaaaaaaaaaa ! Normal | |
548 | .xword 0x7feffffffffffffe ! Normal | |
549 | .xword 0x7fef000000000000 ! Normal | |
550 | .xword 0x7fefffffffffffff ! Normal | |
551 | ||
552 | .align 512 | |
553 | ||
554 | int_data_x: | |
555 | .xword 0x0000000000000000 ! 0 | |
556 | .xword 0x0000000000000001 ! 1 | |
557 | .xword 0x7fffffffffffffff ! | |
558 | .xword 0xffffffffffffffff ! | |
559 | .xword 0xaaaaaaaaaaaaaaaa ! 0 | |
560 | .xword 0x5555555555555555 ! 1 | |
561 | .xword 0x4000000000000000 ! | |
562 | .xword 0x8000000000000000 ! | |
563 | ||
564 | int_data_i: | |
565 | .word 0x00000000 ! 0 | |
566 | .word 0x00000001 ! 1 | |
567 | .word 0x7fffffff ! | |
568 | .word 0xffffffff ! | |
569 | .word 0xaaaaaaaa ! | |
570 | .word 0x55555555 ! | |
571 | .word 0x40000000 ! | |
572 | .word 0x80000000 ! | |
573 | ||
574 | .align 256 | |
575 | ||
576 | fsr_tem_en: | |
577 | .word 0x0f800000 ! TEM - all enabled - rd 0 | |
578 | .word 0x4f800000 ! TEM - all enabled - rd 1 | |
579 | .word 0x8f800000 ! TEM - all enabled - rd 2 | |
580 | .word 0xcf800000 ! TEM - all enabled - rd 3 | |
581 | ||
582 | fsr_tem_dis: | |
583 | .word 0x00000000 ! TEM - all disabled | |
584 | .word 0x40000000 ! TEM - all disabled | |
585 | .word 0x80000000 ! TEM - all disabled | |
586 | .word 0xc0000000 ! TEM - all disabled | |
587 | ||
588 | /******************************************************* | |
589 | * My own trap handlers | |
590 | *******************************************************/ | |
591 | ||
592 | ||
593 | ||
594 | .global T0_Fp_exception_ieee_754 | |
595 | .global T0_Fp_exception_other | |
596 | .global T0_Fp_unimplemented | |
597 | ||
598 | T0_Fp_exception_ieee_754: | |
599 | rdpr %tpc, %i0 | |
600 | rdpr %tnpc, %i1 | |
601 | rdpr %tstate, %i1 | |
602 | rdpr %tt, %i1 | |
603 | setx scratch, %l0, %l5 ! scratch | |
604 | stx %fsr, [%l5+0x0] | |
605 | ldx [%l5+0x0], %fsr ! Need to test the sync operation | |
606 | done | |
607 | nop | |
608 | ||
609 | T0_Fp_unimplemented: | |
610 | T0_Fp_exception_other: | |
611 | rdpr %tpc, %i0 | |
612 | rdpr %tnpc, %i1 | |
613 | rdpr %tstate, %i1 | |
614 | rdpr %tt, %i1 | |
615 | setx scratch, %l0, %l5 ! scratch | |
616 | stx %fsr, [%l5+0x0] | |
617 | ldx [%l5+0x0], %fsr ! Need to test the sync operation | |
618 | done | |
619 | nop | |
620 | ||
621 | ||
622 | .data | |
623 | .align 128 | |
624 | ||
625 | scratch: | |
626 | .word 0x00000000 | |
627 | .word 0x00000000 | |
628 | .word 0x00000000 | |
629 | .word 0x00000000 | |
630 | .word 0x00000000 | |
631 | .word 0x00000000 | |
632 | .word 0x00000000 | |
633 | .word 0x00000000 | |
634 |