|
|
1.1 ! root 1: ! 2: #include "fp.h" ! 3: #include "fp_in_krnl.h" ! 4: ! 5: ! 6: .text ! 7: .globl Kfnorm # Kfnorm(hfs) ! 8: Kfnorm: .word 0x007c ! 9: # clrl r1 ! 10: movl r0,r4 # copy to temporary. ! 11: jneq inr0 ! 12: movl r1,r5 ! 13: clrl r3 # r3 - pos of m.s.b ! 14: inr1: ffs r5,r6 ! 15: incl r6 ! 16: addl2 r6,r3 ! 17: shrl r6,r5,r5 ! 18: jneq inr1 ! 19: cmpl $0,r3 ! 20: jeql retzero ! 21: jmp cmpshift ! 22: inr0: movl $32,r3 ! 23: inr00: ffs r4,r6 ! 24: incl r6 ! 25: addl2 r6,r3 ! 26: shrl r6,r4,r4 ! 27: jneq inr00 ! 28: ! 29: cmpshift: ! 30: # compute the shift (r4). ! 31: subl3 r3,$HID_R0R1,r4 ! 32: jlss shiftr # if less then zero we shift right. ! 33: shlq r4,r0,r0 # else we shift left. ! 34: subl2 r4,r2 # uodate exponent. ! 35: jleq underflow # if less then 0 (biased) it is underflow. ! 36: jmp combine # go to combine exponent and fraction. ! 37: shiftr: ! 38: mnegl r4,r4 ! 39: shrq r4,r0,r0 # shift right. ! 40: addl2 r4,r2 # update exponent ! 41: cmpl r2,$256 ! 42: jgeq overflow # check for overflow. ! 43: combine: ! 44: andl2 $CLEARHID,r0 # clear the hidden bit. ! 45: shal $EXPSHIFT,r2,r2 # shift the exponent to its proper place. ! 46: orl2 r2,r0 ! 47: ret ! 48: ! 49: underflow: ! 50: clrl r0 ! 51: orl2 $HFS_UNDF,*4(fp) ! 52: ret ! 53: ! 54: overflow: ! 55: orl2 $HFS_OVF,*4(fp) ! 56: ret ! 57: retzero: ! 58: clrl r0 ! 59: clrl r1 ! 60: ret ! 61:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.