/ ldexp.s (emx+gcc) -- Copyright (c) 1991-1993 by Eberhard Mattes

#include <libm.h>

        .globl  FUN(ldexp)

        .text

        .align  2, 0x90

/ double ldexp (double x, int exp)

#define x        4(%esp)
#if defined (LONG_DOUBLE)
#define exp     16(%esp)
#else
#define exp     12(%esp)
#endif

DEF(ldexp)
        fildl   exp                     / exp
        FLD     x                       / x
        fscale
        fstp    %st(1)
        CONV(x)                         / convert to double
        _xam
        j_inf   1f
        ret

        .align  2, 0x90
1:      SETERRNO($ERANGE)
        ret
