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