Lines Matching +full:9 +full:- +full:bit
23 * the restrictions contained in a BSD-style copyright.)
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
138 bset #31,%d0 | set explizit bit
139 add.w #0x3fff-0x7f,%d1 | re-bias the exponent.
140 9: move.l %d1,(%a0)+ | fp_ext.sign, fp_ext.exp
149 | exponent is zero, so explizit bit is already zero too
151 jeq 9b
152 move.w #0x4000-0x7f,%d1
153 jra 9b
156 bclr #31,%d0 | clear explizit bit
158 jra 9b
164 printf PCONV,"d2e: %p%p -> %p(",3,%d0,%d1,%a0
176 bset #31,%d0 | set explizit bit
177 add.w #0x3fff-0x3ff,%d1 | re-bias the exponent.
178 9: move.l %d1,(%a0)+ | fp_ext.sign, fp_ext.exp
187 or.l %d1,-(%a0)
194 | exponent is zero, so explizit bit is already zero too
196 jeq 9b
197 move.w #0x4000-0x3ff,%d1
198 jra 9b
201 bclr #31,%d0 | clear explizit bit
203 jra 9b
221 | The high bit is set, so normalization is irrelevant.
239 tst.b %d0 | test guard bit
240 jpl 9f | zero is closer
241 btst #0,(11,%a0) | test lsb bit
244 jeq 9f | round to zero
247 jcc 9f
249 jcc 9f
252 9: printf PNORM,"%p(",1,%a0
258 jcs 9b | %d2 < 2, round to zero
260 tst.b (1,%a0) | to -inf
262 jra 9b | positive, round to zero
265 jra 9b | negative, round to zero
275 move.b (-4,%a0),%d0
279 clr.w -(%a0)
289 move.w -(%a0),%d2
298 | fancy 64-bit double-shift begins here
308 or.l %d1,-(%a0)
312 move.b (-4,%a0),%d0
316 clr.b (-4,%a0)
322 move.b %d0,(-4,%a0)
331 move.w -(%a0),%d2
347 move.b (-4,%a0),%d0
348 clr.b (-4,%a0)
366 move.w -(%a0),%d2
377 1: clr.b (-4,%a0)
388 move.b %d0,(-4,%a0)
400 move.l %d0,-(%a0)
414 | we have maybe a NaN, shift off the highest bit
446 | The high bit is set, so normalization is irrelevant.
463 tst.b %d0 | test guard bit
464 jpl 9f | zero is closer
465 btst #0,(11,%a0) | test lsb bit
468 jeq 9f | round to zero
471 jcc 9f
473 jcc 9f
476 9: printf PNORM,"%p(",1,%a0
482 jcs 9b | %d2 < 2, round to zero
484 tst.b (1,%a0) | to -inf
486 jra 9b | positive, round to zero
489 jra 9b | negative, round to zero
500 move.b (-4,%a0),%d0
504 clr.w -(%a0)
513 move.w -(%a0),%d2
523 | This is exactly the same 64-bit double shift as seen above.
533 or.l %d1,-(%a0)
537 move.b (-4,%a0),%d0
541 clr.b (-4,%a0)
547 move.b %d0,(-4,%a0)
556 move.w -(%a0),%d2
573 move.b (-4,%a0),%d0
574 clr.b (-4,%a0)
592 move.w -(%a0),%d2
603 1: clr.b (-4,%a0)
614 move.b %d0,(-4,%a0)
630 | we have maybe a NaN, shift off the highest bit
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
668 sub.w #0x4000-0x3ff,%d2 | will the exponent fit?
678 jne fp_nd_checkround | Are they non-zero?
680 9: subq.l #8,%a0
685 | Be careful with the X bit! It contains the lsb
688 fp_set_sr FPSR_EXC_INEX2 | INEX2 bit
689 and.w #0xf800,(2,%a0) | clear bits 0-10
692 tst.l %d0 | test guard bit
693 jpl 9b | zero is closer
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
698 | bit is set, then the number is odd, so rounding works like
699 | in grade-school arithmetic (i.e. 1.5 rounds to 2.0)
705 jeq 9b | round to zero
709 jcc 9b | no overflow, good.
710 addq.l #1,-(%a0) | extend to high lword
714 | reset the high bit, and increment the exponent.
716 addq.w #1,-(%a0)
725 jcs 9b | %d2 < 2, round to zero
727 | Round to +Inf or -Inf. High word of %d2 contains the
729 swap %d2 | to -inf
732 jra 9b | positive, round to zero
736 jra 9b | negative, round to zero
740 fp_set_sr FPSR_EXC_UNFL | set UNFL bit
741 move.w #0x3c01,(-2,%a0) | 2**-1022
745 | Again, another 64-bit double shift.
761 bset #0,%d0 | Yes, so set the "sticky bit".
763 | Another 64-bit single shift and store
776 bset #0,%d0 | Sticky bit.
799 | i.e. pathologically small (exponent is 2**-16383) numbers.
803 1: fp_set_sr FPSR_EXC_UNFL | Set UNFL bit
805 clr.l -(%a0)
806 move.w #0x3c01,-(%a0) | i.e. 2**-1022
819 1: move.w #0x7fff,(-2,%a0)
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
862 sub.w #0x4000-0x7f,%d2 | will the exponent fit?
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?
885 fp_set_sr FPSR_EXC_INEX2 | INEX2 bit
886 clr.b -(%a0) | clear low byte of high lword
890 tst.b %d0 | test guard bit
891 jpl 9f | zero is closer
892 btst #8,%d0 | test lsb bit
896 jeq 9f | round to zero
900 jcc 9f | no overflow, good.
905 addq.w #1,-(%a0)
908 9: subq.l #4,%a0
915 jcs 9b | %d2 < 2, round to zero
917 tst.b (-3,%a0) | to -inf
919 jra 9b | positive, round to zero
920 3: tst.b (-3,%a0) | to +inf
922 jra 9b | negative, round to zero
926 fp_set_sr FPSR_EXC_UNFL | set UNFL bit
927 move.w #0x3f81,(-2,%a0) | 2**-126
931 | a 32-bit shift.
941 bset #0,%d0 | Sticky bit.
946 bset #0,%d0 | Sticky bit.
961 1: move.w #0x7fff,(-2,%a0)
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.
997 1: fp_set_sr FPSR_EXC_UNFL | Set UNFL bit
999 clr.l -(%a0)
1000 move.w #0x3f81,-(%a0) | i.e. 2**-126
1013 | normalize an extended with single (23-bit) precision
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?
1045 fp_set_sr FPSR_EXC_INEX2 | INEX2 bit
1046 clr.b -(%a0) | clear low byte of high lword
1050 tst.b %d0 | test guard bit
1051 jpl 9f | zero is closer
1052 btst #8,%d0 | test lsb bit
1056 jeq 9f | round to zero
1060 jcc 9f | no overflow, good.
1065 addq.w #1,-(%a0)
1068 9: subq.l #4,%a0
1075 jcs 9b | %d2 < 2, round to zero
1077 tst.b (-3,%a0) | to -inf
1079 jra 9b | positive, round to zero
1080 3: tst.b (-3,%a0) | to +inf
1082 jra 9b | negative, round to zero
1091 1: move.w #0x7fff,(-2,%a0)
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
1156 9: tst.w (-4,%a0)
1160 printf PCONV,"-> %p\n",1,%d0
1165 1: printf PCONV,"-> %p\n",1,%d0
1168 fp_set_sr FPSR_EXC_INEX2 | INEX2 bit
1177 tst.l %d1 | test guard bit
1178 jpl 9b | zero is closer
1179 btst %d2,%d0 | test lsb bit (%d2 still 0)
1184 jeq 9b
1187 jra 9b
1190 jcs 9b | %d2 < 2, round to zero
1192 tst.w (-4,%a0) | to -inf
1194 jra 9b | positive, round to zero
1195 3: tst.w (-4,%a0) | to +inf
1197 jra 9b | negative, round to zero
1198 | we are only want -2**127 get correctly rounded here,
1199 | since the guard bit is in the lower lword.
1204 move.l (4,%a0),%d1 | test guard bit
1205 jpl 9b | zero is closer
1208 jra 9b
1217 fp_clr_sr FPSR_EXC_UNFL | fp_normalize_ext has set this bit
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
1248 | fp_normalize_ext has set this bit already
1253 1: printf PCONV,"-> %p\n",1,%d0
1277 1: sub.w #0x3fff-0x3ff,%d2
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
1381 jne 9f
1383 jne 9f
1386 2: moveq #FPSR_CC_NAN-24,%d1
1388 lsl.l #1,%d2 | ignore high bit
1392 moveq #FPSR_CC_INF-24,%d1
1394 9: move.b %d0,(FPD_FPSR+0,FPDATA) | set condition test result
1407 1: bset #FPSR_AEXC_IOP,%d0 | set IOP bit
1410 bset #FPSR_AEXC_OVFL,%d0 | set OVFL bit
1415 bset #FPSR_AEXC_UNFL,%d0 | set UNFL bit
1418 bset #FPSR_AEXC_DZ,%d0 | set DZ bit
1425 1: bset #FPSR_AEXC_INEX,%d0 | set INEX bit