Lines Matching +full:exact +full:- +full:len
12 | value in memory; d0 contains the k-factor sign-extended
13 | to 32-bits. The input may be either normalized,
18 | Saves and Modifies: D2-D7,A2,FP2
23 | The k-factor is saved for use in d7. Clear the
43 | A6. Calculate LEN.
44 | LEN is the number of digits to be displayed. The
45 | k-factor can dictate either the total number of digits,
49 | If LEN is computed to be greater than 17, set OPERR in
50 | USER_FPSR. LEN is stored in d4.
54 | of decimal places needed to insure LEN integer digits
67 | A9. Scale X -> Y.
74 | compensated for by 'or-ing' in the INEX2 flag to
85 | A13. Check for LEN digits.
86 | If the int operation results in more than LEN digits,
87 | or less than LEN -1 digits, adjust ILOG and repeat from
89 | result is exactly 10^LEN, decrement ILOG and divide
93 | The binstr routine is used to convert the LEN digit
95 | to be a fraction; i.e. (mantissa)/10^LEN and adjusted
112 | d0: scratch; LEN input to binstr
114 | d2: upper 32-bits of mantissa for binstr
115 | d3: scratch;lower 32-bits of mantissa for binstr
116 | d4: LEN
119 | d7: k-factor
165 moveml %d2-%d7/%a2,-(%a7)
166 fmovemx %fp0-%fp2,-(%a7)
169 | The k-factor is saved for use in d7. Clear BINDEC_FLG for
177 movel %d0,%d7 |move k-factor to d7
217 | ILOG is the log base 10 of the input value. It is approx-
224 | d0: k-factor/exponent
230 | d7: k-factor/Unchanged
244 movel #-4933,%d6 |force ILOG = -4933
266 fmovel #0,%FPSR |zero all of fpsr - nothing needed
276 | A6. Calculate LEN.
277 | LEN is the number of digits to be displayed. The k-factor
282 | If LEN is computed to be greater than 17, set OPERR in
283 | USER_FPSR. LEN is stored in d4.
290 | d4: exc picture/LEN
293 | d7: k-factor/Unchanged
307 bles k_neg |if k <= 0, LEN = ILOG + 1 - k
308 movel %d7,%d4 |if k > 0, LEN = k
309 bras len_ck |skip to LEN check
315 tstl %d4 |LEN check: branch on sign of LEN
316 bles LEN_ng |if neg, set LEN = 1
317 cmpl #17,%d4 |test if LEN > 17
319 movel #17,%d4 |set max LEN = 17
325 moveql #1,%d4 |min LEN is 1
330 | of decimal places needed to insure LEN integer digits
339 | ----------------------------------------------
359 | d0: exponent/scratch - final is 0
361 | d3: x/scratch - offset ptr into PTENRM array
362 | d4: LEN/Unchanged
365 | d7: k-factor/Unchanged
380 cmpl %d6,%d7 |test k - ILOG
384 movel %d6,%d0 |calc ILOG + 1 - LEN in d0
386 subl %d4,%d0 |sub off LEN
393 cmpl #0xffffecd4,%d0 |test iscale <= -4908
450 | A9. Scale X -> Y.
457 | with a multiply by 10^8 and 10^16, which is exact since
458 | 10^24 is exact. If the input was denormalized, we must
467 | d4: LEN/Unchanged
470 | d7: k-factor/Unchanged
487 fdivx %fp1,%fp0 |calculate X / SCALE -> Y to fp0
493 fmovemx %fp1-%fp1,-(%a7) |load ETEMP with 10^ISCALE
494 movel 8(%a0),-(%a7) |load FPTEMP with input arg
495 movel 4(%a0),-(%a7)
496 movel (%a0),-(%a7)
499 clrl -(%a7) |clear lword on stack
502 moveb #BUSY_SIZE-4,1(%a7) |write current busy size
516 fmulx %fp1,%fp0 |calculate X * SCALE -> Y to fp0
521 | for by 'or-ing' in the INEX2 flag to the lsb of Y.
528 | d4: LEN/Unchanged
531 | d7: k-factor/Unchanged
569 | d4: LEN/Unchanged
572 | d7: k-factor/Unchanged
576 | a6: temp pointer to FP_SCR2(a6) - orig value saved and restored
586 moveml %d0-%d1/%a0-%a1,-(%a7) |save regs used by sintd0
587 movel L_SCR1(%a6),-(%a7)
588 movel L_SCR2(%a6),-(%a7)
593 orl #0x80000000,(%a0) |if neg, use -Y
595 movel USER_FPSR(%a6),-(%a7)
601 moveml (%a7)+,%d0-%d1/%a0-%a1 |restore regs used by sint
606 | A13. Check for LEN digits.
607 | If the int operation results in more than LEN digits,
608 | or less than LEN -1 digits, adjust ILOG and repeat from
610 | result is exactly 10^LEN, decrement ILOG and divide
611 | the mantissa by 10. The calculation of 10^LEN cannot
612 | be inexact, since all powers of ten up to 10^27 are exact
613 | in extended precision, so the use of a previous power-of-ten
622 | d4: LEN/LEN adjusted
625 | d7: k-factor/Unchanged
631 | fp2: x/10^LEN
640 bne not_zr |if non-zero, go to second test
642 | Compute 10^(LEN-1)
645 movel %d4,%d0 |put LEN in d0
646 subql #1,%d0 |d0 = LEN -1
654 tstl %d0 |test if LEN is zero
657 | 10^LEN-1 is computed for this test and A14. If the input was
658 | denormalized, check only the case in which YINT > 10^LEN.
665 | Compare abs(YINT) to 10^(LEN-1) and 10^LEN
669 fcmpx %fp2,%fp0 |compare abs(YINT) with 10^(LEN-1)
674 fmuls FTEN,%fp2 |compute 10^LEN
677 fmuls FTEN,%fp2 |compute 10^LEN
678 fcmpx %fp2,%fp0 |compare abs(YINT) with 10^LEN
691 | and shouldn't have another; this is to check if abs(YINT) = 10^LEN
692 | 10^LEN is again computed using whatever table is in a1 since the
697 movel %d4,%d0 |put LEN in d0
705 tstl %d0 |test if LEN is zero
708 fcmpx %fp2,%fp0 |check if abs(YINT) = 10^LEN
712 addql #1,%d4 | and inc LEN
713 fmuls FTEN,%fp2 | if LEN++, the get 10^^LEN
717 | The binstr routine is used to convert the LEN digit
719 | to be a fraction; i.e. (mantissa)/10^LEN and adjusted
727 | d0: x/LEN call to binstr - final is 0
729 | d2: x/ms 32-bits of mant of abs(YINT)
730 | d3: x/ls 32-bits of mant of abs(YINT)
731 | d4: LEN/Unchanged
734 | d7: k-factor/Unchanged
741 | fp2: 10^LEN/Unchanged
749 fdivx %fp2,%fp0 |divide abs(YINT) by 10^LEN
751 fmovex %fp0,(%a0) |move abs(YINT)/10^LEN to memory
778 movel %d4,%d0 |put LEN in d0 for binstr call
790 | -----------------------------------------
792 | -----------------------------------------
795 | is non-zero, OPERR is signaled. In all cases, all 4 digits are
800 | d0: x/LEN call to binstr - final is 0
802 | d2: x/ms 32-bits of exp fraction/scratch
803 | d3: x/ls 32-bits of exp fraction
804 | d4: LEN/Unchanged
807 | d7: k-factor/Unchanged
813 | fp2: 10^LEN/Unchanged
823 fbeq den_zero |if zero, use k-factor or 4933
828 tstl %d7 |check sign of the k-factor
881 | d0: x/scratch - final is x
884 | d4: LEN/Unchanged
887 | d7: k-factor/Unchanged
893 | fp2: 10^LEN/Unchanged
915 fmovemx (%a7)+,%fp0-%fp2
916 moveml (%a7)+,%d2-%d7/%a2