--- cci/sys/tahoe/Kmuld.x 2019/07/28 12:24:19 1.1.1.1 +++ cci/sys/tahoe/Kmuld.x 2019/07/28 12:30:03 1.1.1.2 @@ -79,9 +79,6 @@ _Kmuld: .word 0xffc jmp 1b realshift: shrq r5,r0,r0 - bbc $0,r1,shiftmore - incl r1 /* rounding. */ -shiftmore: shrq $1,r0,r0 comb: andl2 $CLEARHID,r0 @@ -91,8 +88,21 @@ comb: jlss 1f orl2 $HFS_OVF,*20(fp) sign: -1: bbc $0,r3,done +1: bbc $0,r3,1f orl2 $SIGNBIT,r0 +/* + * 3/31/86 - Check if rounding is needed. If the accumulator least is + * 0xfffffff0-0xffffffff and the lower half of the accumulator most is + * 0xffff, then rounding could have significance and should be done. + */ +1: andl3 $0xfffffff0,r1,r2 + cmpl $0xfffffff0,r2 + jneq done + andl3 $0xffff,r0,r2 + cmpl $0xffff,r2 + jneq done + clrl r1 + incl r0 done: ret @@ -103,9 +113,17 @@ done: ret ret overflow: orl2 $HFS_OVF,*20(fp) + movl $0x7fffffff,r0 + bbc $0,r3,1f + orl2 $SIGNBIT,r0 +1: mnegl $1,r1 ret underflow: orl2 $HFS_UNDF,*20(fp) + movl $0x800000,r0 + bbc $0,r3,1f + orl2 $SIGNBIT,r0 +1: clrl r1 ret