Annotation of cci/usr/src/lib/libc/tahoe/gen/cvtfl.x, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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