.global expl
.type expl,@function
expl:
fldt 4(%esp)
mov 12(%esp), %ax
or $0x8000, %ax
sub $0xbfdf, %ax
cmp $45, %ax
jbe 2f
test %ax, %ax
fld1
js 1f
# if |x|>=0x1p14 or nan return 2^trunc(x)
fscale
fstp %st(1)
ret
# if |x|<0x1p-32 return 1+x
1: faddp
ret
2: fldl2e
subl $44, %esp
# 2^hi = exp2l(hi)
fmul %st(1),%st
fld %st(0)
fstpt (%esp)
fstpt 16(%esp)
fstpt 32(%esp)
.hidden __exp2l
call __exp2l
# if 2^hi == inf return 2^hi
fld %st(0)
fstpt (%esp)
cmpw $0x7fff, 8(%esp)
je 1f
fldt 32(%esp)
fldt 16(%esp)
fld %st(1)
pushl $0x41f00000
pushl $0x00100000
fldl (%esp)
fmulp
fld %st(2)
fsub %st(1), %st
faddp
fld %st(2)
fsub %st(1), %st
pushl $0x3ff71547
pushl $0x65200000
fldl (%esp)
fld %st(2)
fmul %st(1), %st
fsubp %st, %st(4)
fmul %st(1), %st
faddp %st, %st(3)
pushl $0x3de705fc
pushl $0x2f000000
fldl (%esp)
fmul %st, %st(2)
fmulp %st, %st(1)
fxch %st(2)
faddp
faddp
pushl $0xbfbe
pushl $0x82f0025f
pushl $0x2dc582ee
fldt (%esp)
addl $36,%esp
fmulp %st, %st(2)
faddp
f2xm1
fmul %st(1), %st
faddp
1: addl $44, %esp
ret