Annotation of 43BSDTahoe/lib/libc/tahoe/fpe/sfnorm.s, revision 1.1.1.1

1.1       root        1: #ifdef LIBC_SCCS
                      2:        .asciz  "@(#)sfnorm.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(sfnorm, R2|R3|R4|R5|R6)
                      9:        clrl    r1
                     10:        movl    r0,r4           /* copy to temporary. */
                     11:        jeql    retzero
                     12:        clrl    r3              /* r3 - pos of m.s.b */
                     13: inr00: ffs     r4,r6
                     14:        incl    r6
                     15:        addl2   r6,r3
                     16:        shrl    r6,r4,r4
                     17:        jneq    inr00
                     18: 
                     19: cmpshift:
                     20:                                /* compute the shift (r4). */
                     21:        subl3   r3,$HID_POS,r4
                     22:        jlss    shiftr          /* if less then zero we shift right. */
                     23:        shll    r4,r0,r0        /* else we shift left. */
                     24:        subl2   r4,r2           /* uodate exponent. */
                     25:        jleq    underflow       /* if less then 0 (biased) it is underflow. */
                     26:        jmp     combine         /* go to combine exponent and fraction. */
                     27: shiftr:
                     28:        mnegl   r4,r4
                     29:        shrl    r4,r0,r0        /* shift right. */
                     30:        addl2   r4,r2           /* update exponent */
                     31:        cmpl    r2,$256
                     32:        jgeq    overflow        /* check for overflow. */
                     33: combine:
                     34:        andl2   $CLEARHID,r0    /* clear the hidden bit. */
                     35:        shal    $EXPSHIFT,r2,r2 /* shift the exponent to its proper place. */
                     36:        orl2    r2,r0
                     37:        ret
                     38: 
                     39: underflow:
                     40:        callf   $4,sfpunder
                     41:        ret
                     42: 
                     43: overflow:
                     44:        callf   $4,sfpover
                     45:        ret
                     46: retzero:
                     47:        clrl    r0
                     48:        ret

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.