Lines Matching +full:1 +full:w

9  * 1. Redistributions of source code must retain the above copyright
64 jmi 1f
66 jmi 1f
69 1: printf ,"oops:%p,%p,%p\n",3,%a2@(TASK_MM-8),%a2@(TASK_MM-4),%a2@(TASK_MM)
102 jpl 1f | positive?
103 moveq #1,%d1
105 1: swap %d1
106 move.w #0x3fff+31,%d1
134 lsr.w #8,%d1
136 cmp.w #0xff,%d1 | NaN / Inf?
139 add.w #0x3fff-0x7f,%d1 | re-bias the exponent.
152 move.w #0x4000-0x7f,%d1
157 move.w #0x7fff,%d1
172 lsr.w #5,%d1
174 cmp.w #0x7ff,%d1 | NaN / Inf?
177 add.w #0x3fff-0x3ff,%d1 | re-bias the exponent.
197 move.w #0x4000-0x3ff,%d1
202 move.w #0x7fff,%d1
210 | returns 0 in %d0 for a NaN, otherwise 1
213 printf PCONV,"e2e: %p(",1,%a0
217 cmp.w #0x7fff,%d0 | Inf / NaN?
228 printf PCONV,"%p(",1,%a0
231 moveq #1,%d0
237 move.w (FPD_RND,FPDATA),%d2
243 lsl.b #1,%d0 | check low bits
246 addq.l #1,(8,%a0)
248 addq.l #1,(4,%a0)
250 move.w #0x8000,(4,%a0)
251 addq.w #1,(2,%a0)
252 9: printf PNORM,"%p(",1,%a0
257 subq.w #2,%d2
259 jhi 1f | %d2 > 2, round to +infinity
260 tst.b (1,%a0) | to -inf
263 1: tst.b (1,%a0) | to +inf
279 clr.w -(%a0)
281 printf PNORM,"%p(",1,%a0
284 moveq #1,%d0
289 move.w -(%a0),%d2
290 sub.w %d1,%d2
291 jcc 1f
293 add.w %d2,%d1
294 clr.w %d2
295 1: move.w %d2,(%a0)+
296 move.w %d1,%d2
305 neg.w %d2
306 and.w #0x1f,%d2
313 neg.w %d2
314 add.w #24,%d2
315 jcc 1f
320 1: addq.w #8,%d2
330 add.w #32,%d1
331 move.w -(%a0),%d2
332 sub.w %d1,%d2
333 jcc 1f
335 add.w %d2,%d1
336 clr.w %d2
337 1: move.w %d2,(%a0)+
341 sub.w #32,%d2
342 jcs 1f
349 neg.w %d1
350 add.w #32,%d1
354 1: neg.w %d1 | lower lword is splitted between
359 move.w %d1,%d2
365 add.w #40,%d1
366 move.w -(%a0),%d2
367 sub.w %d1,%d2
368 jcc 1f
370 add.w %d2,%d1
371 clr.w %d2
372 1: move.w %d2,(%a0)+
375 cmp.w #8,%d1
377 1: clr.b (-4,%a0)
378 sub.w #64,%d1
379 jcs 1f
380 add.w #24,%d1
384 1: neg.w %d1
393 1: move.l %d0,%d1 | lower lword is splitted between
397 neg.w %d2
398 add.w #32,%d2
406 1: tst.l (%a0)
408 moveq #1,%d0
410 printf PCONV,"%p(",1,%a0
415 3: lsl.l #1,%d0
416 jeq 1b
438 printf PNORM,"ne: %p(",1,%a0
442 cmp.w #0x7fff,%d0 | Inf / NaN?
453 printf PNORM,"%p(",1,%a0
461 move.w (FPD_RND,FPDATA),%d2
467 lsl.b #1,%d0 | check low bits
470 addq.l #1,(8,%a0)
472 addq.l #1,(4,%a0)
474 addq.w #1,(2,%a0)
475 move.w #0x8000,(4,%a0)
476 9: printf PNORM,"%p(",1,%a0
481 subq.w #2,%d2
483 jhi 1f | %d2 > 2, round to +infinity
484 tst.b (1,%a0) | to -inf
487 1: tst.b (1,%a0) | to +inf
504 clr.w -(%a0)
506 printf PNORM,"%p(",1,%a0
513 move.w -(%a0),%d2
514 sub.w %d1,%d2
515 jcc 1f
517 add.w %d2,%d1
518 clr.w %d2
520 1: move.w %d2,(%a0)+
521 move.w %d1,%d2
530 neg.w %d2
531 and.w #0x1f,%d2
538 neg.w %d2
539 add.w #24,%d2
540 jcc 1f
545 1: addq.w #8,%d2
555 add.w #32,%d1
556 move.w -(%a0),%d2
557 sub.w %d1,%d2
558 jcc 1f
560 add.w %d2,%d1
561 clr.w %d2
563 1: move.w %d2,(%a0)+
567 sub.w #32,%d1
568 jcs 1f
575 neg.w %d1
576 add.w #32,%d1
580 1: neg.w %d1 | lower lword is splitted between
585 move.w %d1,%d2
591 add.w #40,%d1
592 move.w -(%a0),%d2
593 sub.w %d1,%d2
594 jcc 1f
596 add.w %d2,%d1
597 clr.w %d2
598 1: move.w %d2,(%a0)+
601 cmp.w #8,%d1
603 1: clr.b (-4,%a0)
604 sub.w #64,%d1
605 jcs 1f
606 add.w #24,%d1
610 1: neg.w %d1
623 1: tst.l (%a0)
626 printf PNORM,"%p(",1,%a0
632 lsl.l #1,%d1
635 jra 1b
646 | 1: Round to zero
660 printf PNORM,"nd: %p(",1,%a0
664 tst.w %d2
666 cmp.w #0x7fff,%d2
668 sub.w #0x4000-0x3ff,%d2 | will the exponent fit?
670 cmp.w #0x7fe,%d2
681 printf PNORM,"%p(",1,%a0
689 and.w #0xf800,(2,%a0) | clear bits 0-10
690 move.w (FPD_RND,FPDATA),%d2 | rounding mode
695 clr.w %d2 | first set z bit, addx only clears it
696 addx.w %d2,%d2 | test lsb bit
704 lsl.l #1,%d0 | check low bits
710 addq.l #1,-(%a0) | extend to high lword
711 jcc 1f | no overflow, good.
715 move.w #0x8000,(%a0)
716 addq.w #1,-(%a0)
717 cmp.w #0x43ff,(%a0)+ | exponent now overflown?
719 1: subq.l #4,%a0
720 printf PNORM,"%p(",1,%a0
724 2: subq.w #2,%d2
741 move.w #0x3c01,(-2,%a0) | 2**-1022
742 neg.w %d2 | degree of underflow
743 cmp.w #32,%d2 | single or double shift?
744 jcc 1f
752 neg.w %d2
753 add.w #32,%d2
764 1: sub.w #32,%d2
765 cmp.w #32,%d2 | Do we really need to shift?
771 neg.w %d2
772 add.w #32,%d2
775 jeq 1f
777 1: move.l %d0,(%a0)
785 moveq #1,%d0 | Smallest possible fraction,
790 jne 1f
792 jne 1f
794 printf PNORM,"%p(",1,%a0
803 1: fp_set_sr FPSR_EXC_UNFL | Set UNFL bit
806 move.w #0x3c01,-(%a0) | i.e. 2**-1022
808 moveq #1,%d0
812 move.w #0x7ff,%d0
813 and.w (6,%a0),%d0
814 jeq 1f
816 1: fp_set_sr FPSR_EXC_OVFL
817 move.w (FPD_RND,FPDATA),%d2
819 1: move.w #0x7fff,(-2,%a0)
823 printf PNORM,"%p(",1,%a0
827 3: subq.w #2,%d2
831 jne 1b
834 jeq 1b
835 5: move.w #0x43fe,(-2,%a0)
836 moveq #-1,%d0
838 move.w #0xf800,%d0
844 printf PNORM,"%p(",1,%a0
854 printf PNORM,"ns: %p(",1,%a0
858 move.w (%a0)+,%d2
860 cmp.w #0x7fff,%d2
862 sub.w #0x4000-0x7f,%d2 | will the exponent fit?
864 cmp.w #0xfe,%d2
869 jeq 1f
874 1: clr.l (%a0) | zap it from memory.
880 printf PNORM,"%p(",1,%a0
888 move.w (FPD_RND,FPDATA),%d2 | rounding mode
895 lsl.b #1,%d0 | check low bits
904 move.w #0x8000,(%a0)
905 addq.w #1,-(%a0)
906 cmp.w #0x407f,(%a0)+ | exponent now overflown?
909 printf PNORM,"%p(",1,%a0
914 2: subq.w #2,%d2
927 move.w #0x3f81,(-2,%a0) | 2**-126
928 neg.w %d2 | degree of underflow
929 cmp.w #32,%d2 | single or double shift?
937 neg.w %d2
938 add.w #32,%d2
940 jeq 1f
943 1: tst.l (%a0)
951 moveq #1,%d0 | Smallest possible fraction,
956 jeq 1f
958 1: fp_set_sr FPSR_EXC_OVFL
959 move.w (FPD_RND,FPDATA),%d2
961 1: move.w #0x7fff,(-2,%a0)
965 printf PNORM,"%p(",1,%a0
969 3: subq.w #2,%d2
973 jne 1b
976 jeq 1b
977 5: move.w #0x407e,(-2,%a0)
984 jne 1f
986 jne 1f
988 printf PNORM,"%p(",1,%a0
997 1: fp_set_sr FPSR_EXC_UNFL | Set UNFL bit
1000 move.w #0x3f81,-(%a0) | i.e. 2**-126
1002 moveq #1,%d0
1007 printf PNORM,"%p(",1,%a0
1019 printf PNORM,"nsf: %p(",1,%a0
1023 move.w (%a0)+,%d2
1024 cmp.w #0x7fff,%d2
1029 jeq 1f
1034 1: clr.l (%a0) | zap it from memory.
1040 printf PNORM,"%p(",1,%a0
1048 move.w (FPD_RND,FPDATA),%d2 | rounding mode
1055 lsl.b #1,%d0 | check low bits
1064 move.w #0x8000,(%a0)
1065 addq.w #1,-(%a0)
1066 cmp.w #0x407f,(%a0)+ | exponent now overflown?
1069 printf PNORM,"%p(",1,%a0
1074 2: subq.w #2,%d2
1086 jeq 1f
1088 1: fp_set_sr FPSR_EXC_OVFL
1089 move.w (FPD_RND,FPDATA),%d2
1091 1: move.w #0x7fff,(-2,%a0)
1095 printf PNORM,"%p(",1,%a0
1099 3: subq.w #2,%d2
1103 jne 1b
1106 jeq 1b
1107 5: move.w #0x407e,(-2,%a0)
1114 printf PNORM,"%p(",1,%a0
1134 .set inf,(1<<(\b-1))-1 | i.e. MAXINT
1139 move.w (%a0)+,%d2 | exponent
1141 cmp.w #0x7fff,%d2
1143 sub.w #0x3ffe,%d2
1145 cmp.w #\b,%d2
1153 neg.w %d2
1154 add.w #32,%d2
1156 9: tst.w (-4,%a0)
1157 jne 1f
1160 printf PCONV,"-> %p\n",1,%d0
1162 1: neg.\s %d0
1163 jeq 1f
1165 1: printf PCONV,"-> %p\n",1,%d0
1169 neg.w %d2
1170 add.w #32,%d2
1175 move.w (FPD_RND,FPDATA),%d2 | rounding mode
1181 lsl.l #1,%d1 | check low bits
1186 addq.l #1,%d0
1189 2: subq.w #2,%d2
1192 tst.w (-4,%a0) | to -inf
1195 3: tst.w (-4,%a0) | to +inf
1202 5: move.w (FPD_RND,FPDATA),%d2 | rounding mode
1206 lsl.l #1,%d1 | check low bits
1213 jne 1f
1216 1: subq.l #4,%a0
1221 move.w (FPD_RND,FPDATA),%d2 | rounding mode
1222 subq.w #2,%d2
1225 tst.w (-4,%a0) | to -inf
1227 subq.\s #1,%d0
1229 2: tst.w (-4,%a0) | to +inf
1231 addq.\s #1,%d0
1232 3: printf PCONV,"-> %p\n",1,%d0
1237 tst.w (-4,%a0)
1238 jeq 1f
1239 addq.\s #1,%d0
1240 1: printf PCONV,"-> %p\n",1,%d0
1245 jne 1f
1250 1: fp_tst_sr FPSR_EXC_SNAN
1251 jne 1f
1253 1: printf PCONV,"-> %p\n",1,%d0
1261 conv_ext2int w,16
1268 printf PCONV,"e2d: %p(",1,%a0
1272 cmp.w #0x7fff,%d2
1273 jne 1f
1274 move.w #0x7ff,%d2
1277 1: sub.w #0x3fff-0x3ff,%d2
1280 clr.w %d2
1281 2: lsl.w #5,%d2
1285 lsl.l #1,%d0
1306 printf PCONV,"e2s: %p(",1,%a0
1310 cmp.w #0x7fff,%d1
1311 jne 1f
1312 move.w #0xff,%d1
1315 1: sub.w #0x3fff-0x7f,%d1
1318 clr.w %d1
1319 2: lsl.w #8,%d1
1325 printf PCONV,"%08x\n",1,%d0
1356 | printf ,"f: %p\n",1,%a0
1358 move.w (FPD_PREC,FPDATA),%d0
1359 subq.w #1,%d0
1361 jne 1f
1364 1: jsr fp_normalize_double
1365 2:| printf ,"f: %p\n",1,%a0
1372 addq.l #1,%a0
1374 jeq 1f
1376 1: cmp.w #0x7fff,(%a0)+ | exponent
1388 lsl.l #1,%d2 | ignore high bit
1404 jne 1f
1407 1: bset #FPSR_AEXC_IOP,%d0 | set IOP bit
1409 jeq 1f
1411 1: btst #FPSR_EXC_UNFL,%d0 | EXC_UNFL
1412 jeq 1f
1414 jeq 1f
1416 1: btst #FPSR_EXC_DZ,%d0 | EXC_INEX1
1417 jeq 1f
1419 1: btst #FPSR_EXC_OVFL,%d0 | EXC_OVFL
1420 jne 1f
1422 jne 1f
1425 1: bset #FPSR_AEXC_INEX,%d0 | set INEX bit
1452 jeq 1f
1454 1: jra fp_end