Lines Matching +full:- +full:d2
23 * the restrictions contained in a BSD-style copyright.)
49 * something here. %d0 and %d1 is always usable, sometimes %d2 (or
63 tst.l (TASK_MM-8,%a2)
65 tst.l (TASK_MM-4,%a2)
69 1: printf ,"oops:%p,%p,%p\n",3,%a2@(TASK_MM-8),%a2@(TASK_MM-4),%a2@(TASK_MM)
94 | args: %d0 = source (32-bit long)
98 printf PCONV,"l2e: %p -> %p(",2,%d0,%a0
125 | args: %d0 = source (single-precision fp value)
129 printf PCONV,"s2e: %p -> %p(",2,%d0,%a0
139 add.w #0x3fff-0x7f,%d1 | re-bias the exponent.
152 move.w #0x4000-0x7f,%d1
164 printf PCONV,"d2e: %p%p -> %p(",3,%d0,%d1,%a0
177 add.w #0x3fff-0x3ff,%d1 | re-bias the exponent.
187 or.l %d1,-(%a0)
197 move.w #0x4000-0x3ff,%d1
237 move.w (FPD_RND,FPDATA),%d2
238 jne fp_e2e_roundother | %d2 == 0, round to nearest
257 subq.w #2,%d2
258 jcs 9b | %d2 < 2, round to zero
259 jhi 1f | %d2 > 2, round to +infinity
260 tst.b (1,%a0) | to -inf
275 move.b (-4,%a0),%d0
279 clr.w -(%a0)
289 move.w -(%a0),%d2
290 sub.w %d1,%d2
293 add.w %d2,%d1
294 clr.w %d2
295 1: move.w %d2,(%a0)+
296 move.w %d1,%d2
298 | fancy 64-bit double-shift begins here
299 lsl.l %d2,%d0
303 lsl.l %d2,%d0
305 neg.w %d2
306 and.w #0x1f,%d2
307 lsr.l %d2,%d1
308 or.l %d1,-(%a0)
312 move.b (-4,%a0),%d0
313 neg.w %d2
314 add.w #24,%d2
316 clr.b (-4,%a0)
317 lsl.l %d2,%d0
320 1: addq.w #8,%d2
321 lsl.l %d2,%d0
322 move.b %d0,(-4,%a0)
331 move.w -(%a0),%d2
332 sub.w %d1,%d2
335 add.w %d2,%d1
336 clr.w %d2
337 1: move.w %d2,(%a0)+
341 sub.w #32,%d2
347 move.b (-4,%a0),%d0
348 clr.b (-4,%a0)
359 move.w %d1,%d2
366 move.w -(%a0),%d2
367 sub.w %d1,%d2
370 add.w %d2,%d1
371 clr.w %d2
372 1: move.w %d2,(%a0)+
377 1: clr.b (-4,%a0)
388 move.b %d0,(-4,%a0)
394 lsl.l %d2,%d0 | higher and lower lword
397 neg.w %d2
398 add.w #32,%d2
399 lsr.l %d2,%d0
400 move.l %d0,-(%a0)
435 | NOTE: it does _not_ modify %a0/%a1 and the upper word of %d2
461 move.w (FPD_RND,FPDATA),%d2
462 jne fp_ne_roundother | %d2 == 0, round to nearest
481 subq.w #2,%d2
482 jcs 9b | %d2 < 2, round to zero
483 jhi 1f | %d2 > 2, round to +infinity
484 tst.b (1,%a0) | to -inf
500 move.b (-4,%a0),%d0
504 clr.w -(%a0)
513 move.w -(%a0),%d2
514 sub.w %d1,%d2
517 add.w %d2,%d1
518 clr.w %d2
520 1: move.w %d2,(%a0)+
521 move.w %d1,%d2
523 | This is exactly the same 64-bit double shift as seen above.
524 lsl.l %d2,%d0
528 lsl.l %d2,%d0
530 neg.w %d2
531 and.w #0x1f,%d2
532 lsr.l %d2,%d1
533 or.l %d1,-(%a0)
537 move.b (-4,%a0),%d0
538 neg.w %d2
539 add.w #24,%d2
541 clr.b (-4,%a0)
542 lsl.l %d2,%d0
545 1: addq.w #8,%d2
546 lsl.l %d2,%d0
547 move.b %d0,(-4,%a0)
556 move.w -(%a0),%d2
557 sub.w %d1,%d2
560 add.w %d2,%d1
561 clr.w %d2
563 1: move.w %d2,(%a0)+
573 move.b (-4,%a0),%d0
574 clr.b (-4,%a0)
585 move.w %d1,%d2
592 move.w -(%a0),%d2
593 sub.w %d1,%d2
596 add.w %d2,%d1
597 clr.w %d2
598 1: move.w %d2,(%a0)+
603 1: clr.b (-4,%a0)
614 move.b %d0,(-4,%a0)
634 clr.l (-4,%a0)
640 move.l %d0,(-4,%a0)
647 | 2: Round to -Infinity
656 | normalize an extended with double (52-bit) precision
663 move.l (%a0)+,%d2
664 tst.w %d2
666 cmp.w #0x7fff,%d2
668 sub.w #0x4000-0x3ff,%d2 | will the exponent fit?
670 cmp.w #0x7fe,%d2
678 jne fp_nd_checkround | Are they non-zero?
689 and.w #0xf800,(2,%a0) | clear bits 0-10
690 move.w (FPD_RND,FPDATA),%d2 | rounding mode
691 jne 2f | %d2 == 0, round to nearest
694 | here we test the X bit by adding it to %d2
695 clr.w %d2 | first set z bit, addx only clears it
696 addx.w %d2,%d2 | test lsb bit
697 | IEEE754-specified "round to even" behaviour. If the guard
699 | in grade-school arithmetic (i.e. 1.5 rounds to 2.0)
710 addq.l #1,-(%a0) | extend to high lword
716 addq.w #1,-(%a0)
724 2: subq.w #2,%d2
725 jcs 9b | %d2 < 2, round to zero
726 jhi 3f | %d2 > 2, round to +infinity
727 | Round to +Inf or -Inf. High word of %d2 contains the
729 swap %d2 | to -inf
730 tst.b %d2
733 3: swap %d2 | to +inf
734 tst.b %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?
745 | Again, another 64-bit double shift.
748 lsr.l %d2,%d0
751 lsr.l %d2,%d0
752 neg.w %d2
753 add.w #32,%d2
754 lsl.l %d2,%d1
759 lsl.l %d2,%d1
763 | Another 64-bit single shift and store
764 1: sub.w #32,%d2
765 cmp.w #32,%d2 | Do we really need to shift?
770 lsr.l %d2,%d0
771 neg.w %d2
772 add.w #32,%d2
778 lsl.l %d2,%d1
799 | i.e. pathologically small (exponent is 2**-16383) numbers.
805 clr.l -(%a0)
806 move.w #0x3c01,-(%a0) | i.e. 2**-1022
817 move.w (FPD_RND,FPDATA),%d2
818 jne 3f | %d2 = 0 round to nearest
819 1: move.w #0x7fff,(-2,%a0)
827 3: subq.w #2,%d2
828 jcs 5f | %d2 < 2, round to zero
829 jhi 4f | %d2 > 2, round to +infinity
830 tst.b (-3,%a0) | to -inf
833 4: tst.b (-3,%a0) | to +inf
835 5: move.w #0x43fe,(-2,%a0)
836 moveq #-1,%d0
850 | normalize an extended with single (23-bit) precision
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
870 | Set a sticky bit if it is non-zero. This should only
871 | affect the rounding in what would otherwise be equal-
877 jne fp_ns_checkround | Are they non-zero?
886 clr.b -(%a0) | clear low byte of high lword
888 move.w (FPD_RND,FPDATA),%d2 | rounding mode
889 jne 2f | %d2 == 0, round to nearest
905 addq.w #1,-(%a0)
914 2: subq.w #2,%d2
915 jcs 9b | %d2 < 2, round to zero
916 jhi 3f | %d2 > 2, round to +infinity
917 tst.b (-3,%a0) | to -inf
920 3: tst.b (-3,%a0) | to +inf
927 move.w #0x3f81,(-2,%a0) | 2**-126
928 neg.w %d2 | degree of underflow
929 cmp.w #32,%d2 | single or double shift?
931 | a 32-bit shift.
934 lsr.l %d2,%d0
937 neg.w %d2
938 add.w #32,%d2
939 lsl.l %d2,%d1
959 move.w (FPD_RND,FPDATA),%d2
960 jne 3f | %d2 = 0 round to nearest
961 1: move.w #0x7fff,(-2,%a0)
969 3: subq.w #2,%d2
970 jcs 5f | %d2 < 2, round to zero
971 jhi 4f | %d2 > 2, round to +infinity
972 tst.b (-3,%a0) | to -inf
975 4: tst.b (-3,%a0) | to +inf
977 5: move.w #0x407e,(-2,%a0)
993 | i.e. pathologically small (exponent is 2**-16383) numbers.
999 clr.l -(%a0)
1000 move.w #0x3f81,-(%a0) | i.e. 2**-126
1013 | normalize an extended with single (23-bit) precision
1023 move.w (%a0)+,%d2
1024 cmp.w #0x7fff,%d2
1030 | Set a sticky bit if it is non-zero. This should only
1031 | affect the rounding in what would otherwise be equal-
1037 jne fp_nsf_checkround | Are they non-zero?
1046 clr.b -(%a0) | clear low byte of high lword
1048 move.w (FPD_RND,FPDATA),%d2 | rounding mode
1049 jne 2f | %d2 == 0, round to nearest
1065 addq.w #1,-(%a0)
1074 2: subq.w #2,%d2
1075 jcs 9b | %d2 < 2, round to zero
1076 jhi 3f | %d2 > 2, round to +infinity
1077 tst.b (-3,%a0) | to -inf
1080 3: tst.b (-3,%a0) | to +inf
1089 move.w (FPD_RND,FPDATA),%d2
1090 jne 3f | %d2 = 0 round to nearest
1091 1: move.w #0x7fff,(-2,%a0)
1099 3: subq.w #2,%d2
1100 jcs 5f | %d2 < 2, round to zero
1101 jhi 4f | %d2 > 2, round to +infinity
1102 tst.b (-3,%a0) | to -inf
1105 4: tst.b (-3,%a0) | to +inf
1107 5: move.w #0x407e,(-2,%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
1149 lsl.l %d2,%d1
1153 neg.w %d2
1154 add.w #32,%d2
1155 lsr.l %d2,%d0
1156 9: tst.w (-4,%a0)
1160 printf PCONV,"-> %p\n",1,%d0
1165 1: printf PCONV,"-> %p\n",1,%d0
1169 neg.w %d2
1170 add.w #32,%d2
1174 lsr.l %d2,%d0
1175 move.w (FPD_RND,FPDATA),%d2 | rounding mode
1176 jne 2f | %d2 == 0, round to nearest
1179 btst %d2,%d0 | test lsb bit (%d2 still 0)
1189 2: subq.w #2,%d2
1190 jcs 9b | %d2 < 2, round to zero
1191 jhi 3f | %d2 > 2, round to +infinity
1192 tst.w (-4,%a0) | to -inf
1195 3: tst.w (-4,%a0) | to +inf
1198 | we are only want -2**127 get correctly rounded here,
1202 5: move.w (FPD_RND,FPDATA),%d2 | rounding mode
1203 jne 2b | %d2 == 0, round to nearest
1221 move.w (FPD_RND,FPDATA),%d2 | rounding mode
1222 subq.w #2,%d2
1223 jcs 3f | %d2 < 2, round to nearest/zero
1224 jhi 2f | %d2 > 2, round to +infinity
1225 tst.w (-4,%a0) | to -inf
1229 2: tst.w (-4,%a0) | to +inf
1232 3: printf PCONV,"-> %p\n",1,%d0
1237 tst.w (-4,%a0)
1240 1: printf PCONV,"-> %p\n",1,%d0
1253 1: printf PCONV,"-> %p\n",1,%d0
1271 move.l (%a0)+,%d2
1272 cmp.w #0x7fff,%d2
1274 move.w #0x7ff,%d2
1277 1: sub.w #0x3fff-0x3ff,%d2
1280 clr.w %d2
1281 2: lsl.w #5,%d2
1282 lsl.l #7,%d2
1283 lsl.l #8,%d2
1288 or.l %d2,%d0
1298 getuser.l %a1@(-4),%d0,fp_err_ua2,%a1
1315 1: sub.w #0x3fff-0x7f,%d1
1375 bset #FPSR_CC_NEG-24,%d0 | N bit
1379 moveq #FPSR_CC_Z-24,%d1
1386 2: moveq #FPSR_CC_NAN-24,%d1
1387 move.l (%a0)+,%d2
1388 lsl.l #1,%d2 | ignore high bit
1392 moveq #FPSR_CC_INF-24,%d1
1429 move.l %d0,%d2
1435 move.l %d2,%d0
1438 move.l %d2,%d1
1442 move.l %d2,%d1
1447 or.b %d0,%d2
1448 move.l %d2,(FPD_FPSR,FPDATA)