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