Annotation of researchv9/libc/sun/modf.s, revision 1.1.1.1

1.1       root        1:        .data
                      2: /*     .asciz  "@(#)modf.s 1.1 86/02/03 SMI"   */
                      3:        .text
                      4: 
                      5: /*
                      6:  *     double-precision operations: frexp, ldexp, modf
                      7:  *     frexp.s 1.1     83/04/12
                      8:  *
                      9:  */
                     10: #include "fpcrtdefs.h"
                     11: 
                     12: /*
                     13:  * double
                     14:  * modf( value, iptr)
                     15:  *      double value, *iptr;
                     16:  *
                     17:  * return a value v and stores through iptr a value i s.t.:
                     18:  *     v + i == value, and
                     19:  *4.2 BSD:
                     20:  *     1 > v >= 0
                     21:  *     Note that for -0.5 < value < 0, v may not be representable.
                     22:  *System V:
                     23:        v has sign of value and |v| < 1.
                     24:        v is always exact.
                     25:  */
                     26: 
                     27:        .globl  _modf
                     28: _modf: link    a6,#0
                     29:        MCOUNT
                     30:        moveml  a6@(8),d0/d1    | d0/d1 gets x.
                     31:        jsr     Ffloord         | d0/d1 gets floor(x). 4.2 BSD definition.
                     32: |      jsr     Faintd          | d0/d1 gets aint(x). System V definition.
                     33:        movl    a6@(16),a0      | a0 gets address of *iptr.
                     34:        moveml  d0/d1,a0@       | *iptr gets floor(x).
                     35:        lea     a6@(8),a0       | a0 points to x.
                     36:        jsr     Fsubd           | d0/d1 gets floor(x)-x.
                     37:        bchg    #31,d0          | d0/d1 gets x-floor(x) >= 0 unless x is inf or nan.
                     38:        unlk    a6
                     39:        rts

unix.superglobalmegacorp.com

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