Annotation of cci/usr/src/lib/libc/tahoe/gen/cvtdl.x, revision 1.1

1.1     ! root        1: 
        !             2: #include       <machine/fp.h>
        !             3:  
        !             4:        .text
        !             5:        .globl  Xcvtdl
        !             6: _cvtdl:
        !             7:        .globl  Xcvtdu
        !             8: Xcvtdu:
        !             9: Xcvtdl:        .word   0x003c          # we use r2,r3,r4,r5
        !            10: 
        !            11:  #
        !            12:  #Some initializations:
        !            13:  #
        !            14:        clrl    r3              # r3 - negative flag.
        !            15:        movl    4(fp),r0        # fetch operand.
        !            16:        movl    8(fp),r1        
        !            17:  #
        !            18:  #get exponent
        !            19:  #
        !            20:        andl3   $EXPMASK,r0,r2  # r2 will hold the exponent.
        !            21:        jeql    is_reserved     # check for reserved operand. 
        !            22:        cmpl    $ONE_EXP,r2     # if exponent is less then 1,return zero.
        !            23:        jgtr    retzero
        !            24:        andl2   $0!EXPSIGN,r2   # turn off biased exponent sign
        !            25:        shrl    $EXPSHIFT,r2,r2
        !            26:  #
        !            27:  #get fraction
        !            28:  #
        !            29:        bbc     $31,r0,positive # if negative remember it.
        !            30:        incl    r3
        !            31: positive:
        !            32:                                # clear the non fraction parts.
        !            33:        andl2   $(0!(EXPMASK | SIGNBIT)),r0
        !            34:                                # add the hidden bit.
        !            35:        orl2    $(0!CLEARHID),r0
        !            36:        subl2   $24,r2          # compute the shift.
        !            37:        jgtr    shift_left
        !            38:        mnegl   r2,r2
        !            39:        shrl    r2,r0,r0        # shift right.
        !            40:        jmp     shifted
        !            41: shift_left:
        !            42:        cmpl    r2,$7
        !            43:        jgtr    overflow
        !            44: go_on: shlq    r2,r0,r0        # shift right.
        !            45: shifted:
        !            46:        bbc     $0,r3,done      # check for negative
        !            47:        mnegl   r0,r0
        !            48: done:  
        !            49:        ret
        !            50: 
        !            51: retzero:
        !            52:        clrl    r0
        !            53:        ret
        !            54: overflow:
        !            55:        callf   $4,fpover
        !            56:        jmp     go_on
        !            57: 
        !            58: is_reserved:
        !            59:        bbc     $31,r0,retzero
        !            60: 
        !            61:        callf   $4,fpresop
        !            62:        ret
        !            63:        

unix.superglobalmegacorp.com

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