home *** CD-ROM | disk | FTP | other *** search
- / frexp.s (emx+gcc) -- Copyright (c) 1992-1993 by Steffen Haecker
-
- #include <libm.h>
-
- .globl _frexp
-
- .text
-
- .align 2, 0x90
-
- / double frexp (double x, int *exp_ptr)
-
- #define x 4(%esp)
- #define exp_ptr 12(%esp)
-
- _frexp:
- movl exp_ptr, %edx
- movl $0, (%edx)
- fldl __const_M_ONE / -1
- fldl x / x
- ftst
- fstsww %ax
- andw $0x4100, %ax
- xorb $0x40, %ah
- jz 1f / x = 0 ?
- fxtract
- fxch %st(1)
- fistpl (%edx)
- fscale
- incl (%edx)
- 1: fstp %st(1)
- ret
-