Annotation of 43BSDTahoe/lib/libc/tahoe/fpe/divd.s, revision 1.1

1.1     ! root        1: #ifdef LIBC_SCCS
        !             2:        .asciz  "@(#)divd.s     1.1 (Berkeley/CCI) 7/2/86"
        !             3: #endif LIBC_SCCS
        !             4: 
        !             5: #include <tahoemath/fp.h>
        !             6: #include "DEFS.h"
        !             7: 
        !             8: #define        HIDDEN  23      /* here we count from 0 not from 1 as in fp.h */
        !             9: 
        !            10: XENTRY(divd, R2|R3|R4|R5|R6|R7|R8|R9)
        !            11:        clrl    r3              # r3 - sign: 0 for positive,1 for negative.
        !            12:        movl    4(fp),r0
        !            13:        jgeq    1f
        !            14:        movl    $1,r3
        !            15: 1:     movl    12(fp),r2
        !            16:        jgeq    2f
        !            17:        bbc     $0,r3,1f        # seconed operand is negative.
        !            18:        clrl    r3              # if first was negative, make result positive.
        !            19:        jmp     2f
        !            20: 1:     movl    $1,r3           # if first was positive, make result negative.
        !            21: 2:     andl2   $EXPMASK,r0     # compute first 'pure'exponent.
        !            22:        jeql    is_res1
        !            23:        shrl    $EXPSHIFT,r0,r0
        !            24:        subl2   $BIAS,r0        
        !            25:        andl2   $EXPMASK,r2     # compute seconed 'pure'exponent.
        !            26:        jeql    is_res2
        !            27:        shrl    $EXPSHIFT,r2,r2
        !            28:        subl2   $BIAS,r2
        !            29:        subl3   r2,r0,r2        # subtruct the exponents.
        !            30:        addl2   $BIAS,r2
        !            31:        jleq    underf
        !            32:                                # normalization can make the exp. smaller.
        !            33:  #
        !            34:  #     We have the sign in r3,the exponent in r2,now is the time to
        !            35:  #     perform the division...
        !            36:  #
        !            37:        # fetch dividend. (r4,r5)
        !            38:        andl3   $(0!(EXPMASK | SIGNBIT)),4(fp),r4
        !            39:        orl2    $(0!CLEARHID),r4
        !            40:        movl    8(fp),r5
        !            41:  
        !            42:        # fetch divisor : (r6,r7)
        !            43:        andl3   $(0!(EXPMASK | SIGNBIT)),12(fp),r6
        !            44:        orl2    $(0!CLEARHID),r6
        !            45:        movl    16(fp),r7
        !            46: 
        !            47:        movl    $0,r0           # init r0,r1 to be zeros
        !            48:        movl    $0,r1
        !            49:        movl    $(0!CLEARHID),r8# r8 first bit to set (if).
        !            50:        shll    $1,r8,r8        # to have one more bit,because we might
        !            51:                                # have to shift left to normelize.
        !            52:        movl    $0,r9
        !            53: 
        !            54: 2:
        !            55:        subl2   r7,r5
        !            56:        sbwc    r6,r4
        !            57:        jgeq    1f
        !            58:        addl2   r7,r5
        !            59:        adwc    r6,r4
        !            60:        shlq    $1,r4,r4
        !            61:        shrq    $1,r8,r8
        !            62:        jeql    over
        !            63:        jmp     2b
        !            64: 1:     
        !            65:        orl2    r8,r0
        !            66:        orl2    r9,r1
        !            67:        shlq    $1,r4,r4
        !            68:        shrq    $1,r8,r8
        !            69:        jneq    2b
        !            70:        
        !            71: over:
        !            72:        callf   $4,fnorm
        !            73: sign:
        !            74: 1:     bbc     $0,r3,done
        !            75:        orl2    $SIGNBIT,r0
        !            76: done:  ret
        !            77: 
        !            78: is_res1:
        !            79:        bbc     $31,4(fp),retz
        !            80:        callf   $4,fpresop
        !            81:        ret
        !            82: is_res2:
        !            83:        bbc     $31,12(fp),z_div
        !            84:        callf   $4,fpresop
        !            85:        ret
        !            86: retz:
        !            87:          clrl  r0
        !            88:          clrl  r1
        !            89:          ret
        !            90: underf:
        !            91:        callf   $4,fpunder
        !            92:        ret
        !            93: z_div:
        !            94:        callf   $4,fpzdiv
        !            95:        ret

unix.superglobalmegacorp.com

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