|
|
1.1 ! root 1: #ifdef LIBC_SCCS ! 2: .asciz "@(#)cvtdl.s 1.1 (Berkeley/CCI) 7/2/86" ! 3: #endif LIBC_SCCS ! 4: ! 5: #include <tahoemath/fp.h> ! 6: #include "DEFS.h" ! 7: ! 8: XENTRY(cvtdu, R2|R3|R4|R5) ! 9: jbr 1f ! 10: ! 11: XENTRY(cvtdl, R2|R3|R4|R5) ! 12: # ! 13: #Some initializations: ! 14: # ! 15: 1: ! 16: movl 4(fp),r0 # fetch operand. ! 17: movl 8(fp),r1 ! 18: clrl r3 # r3 - negative flag. ! 19: # ! 20: #get exponent ! 21: # ! 22: andl3 $EXPMASK,r0,r2 # r2 will hold the exponent. ! 23: jeql is_reserved # check for reserved operand. ! 24: cmpl $ONE_EXP,r2 # if exponent is less then 1,return zero. ! 25: jgtr retzero ! 26: andl2 $0!EXPSIGN,r2 # turn off biased exponent sign ! 27: shrl $EXPSHIFT,r2,r2 ! 28: # ! 29: #get fraction ! 30: # ! 31: bbc $31,r0,positive # if negative remember it. ! 32: incl r3 ! 33: positive: ! 34: # clear the non fraction parts. ! 35: andl2 $(0!(EXPMASK | SIGNBIT)),r0 ! 36: # add the hidden bit. ! 37: orl2 $(0!CLEARHID),r0 ! 38: subl2 $24,r2 # compute the shift. ! 39: jgtr shift_left ! 40: mnegl r2,r2 ! 41: shrl r2,r0,r0 # shift right. ! 42: jmp shifted ! 43: shift_left: ! 44: cmpl r2,$7 ! 45: jgtr overflow ! 46: go_on: shlq r2,r0,r0 # shift right. ! 47: shifted: ! 48: bbc $0,r3,done # check for negative ! 49: mnegl r0,r0 ! 50: done: ! 51: ret ! 52: ! 53: retzero: ! 54: clrl r0 ! 55: ret ! 56: overflow: ! 57: callf $4,fpover ! 58: jmp go_on ! 59: ! 60: is_reserved: ! 61: bbc $31,r0,retzero ! 62: ! 63: callf $4,fpresop ! 64: ret
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.