Annotation of 42BSD/usr.lib/libnm/sin.s, revision 1.1.1.1

1.1       root        1: # double float sin(),cos()
                      2: #coefficients are from Hart & Cheney  SIN3370 (18.80D)
                      3: .text
                      4: .align 1
                      5: .globl _sin
                      6: .globl _cos
                      7: _sin:
                      8:        .word 0x03c0
                      9:        bispsw  $0xe0
                     10:        clrl    r9      
                     11:        movd    4(ap),r0
                     12:        jgeq    range
                     13:        movl    $2,r9
                     14:        jbr     negarg
                     15: 
                     16: .align 1
                     17: _cos:
                     18:        .word   0x0fc0
                     19:        bispsw  $0xe0
                     20:        movl    $1,r9
                     21:        movd    4(ap),r0
                     22:        jgeq    range
                     23: negarg:
                     24:        mnegd   r0,r0
                     25: 
                     26: range:
                     27:        emodd   twoopi,twoopix,r0,r8,r6
                     28:        addl2   r9,r8
                     29:        bicb2   $~03,r8
                     30:        caseb   r8,$0,$3
                     31: bse:   .word   qda-bse,qdb-bse,qdc-bse,qdd-bse
                     32: qdb:   subd3   r6,$0d1.0e+0,r6
                     33:        jbr     qda
                     34: qdc:   mnegd   r6,r6
                     35:        jbr     qda
                     36: qdd:   subd2   $0d1.0e+0,r6
                     37: qda:
                     38:        muld3   r6,r6,r8
                     39:        polyd   r8,$4,pcoef
                     40:        muld2   r0,r6
                     41:        polyd   r8,$4,qcoef
                     42:        divd3   r0,r6,r0
                     43:        ret
                     44: .data
                     45: .align 2
                     46: twoopi:.double 0d6.36619772367581340000e-01
                     47: qcoef:.double  0d1.00000000000000000000e+00
                     48:  .double       0d1.32653490878613630000e+02
                     49:  .double       0d9.46309610153820810000e+03
                     50:  .double       0d4.08179225234329970000e+05
                     51:  .double       0d8.64455865292253430000e+06
                     52: pcoef:.double  0d1.45968840666576870000e+02
                     53:  .double       0d-1.38472724998245280000e+04
                     54:  .double       0d4.40103053537526640000e+05
                     55:  .double       0d-4.94290810090284410000e+06
                     56:  .double       0d1.35788409787737560000e+07
                     57: twoopix: .byte 0x29

unix.superglobalmegacorp.com

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