1570af302Sopenharmony_ci.global expm1l
2570af302Sopenharmony_ci.type expm1l,@function
3570af302Sopenharmony_ciexpm1l:
4570af302Sopenharmony_ci	fldt 4(%esp)
5570af302Sopenharmony_ci	fldl2e
6570af302Sopenharmony_ci	fmulp
7570af302Sopenharmony_ci	mov $0xc2820000,%eax
8570af302Sopenharmony_ci	push %eax
9570af302Sopenharmony_ci	flds (%esp)
10570af302Sopenharmony_ci	pop %eax
11570af302Sopenharmony_ci	fucomp %st(1)
12570af302Sopenharmony_ci	fnstsw %ax
13570af302Sopenharmony_ci	sahf
14570af302Sopenharmony_ci	fld1
15570af302Sopenharmony_ci	jb 1f
16570af302Sopenharmony_ci		# x*log2e < -65, return -1 without underflow
17570af302Sopenharmony_ci	fstp %st(1)
18570af302Sopenharmony_ci	fchs
19570af302Sopenharmony_ci	ret
20570af302Sopenharmony_ci1:	fld %st(1)
21570af302Sopenharmony_ci	fabs
22570af302Sopenharmony_ci	fucom %st(1)
23570af302Sopenharmony_ci	fnstsw %ax
24570af302Sopenharmony_ci	fstp %st(0)
25570af302Sopenharmony_ci	fstp %st(0)
26570af302Sopenharmony_ci	sahf
27570af302Sopenharmony_ci	ja 1f
28570af302Sopenharmony_ci	f2xm1
29570af302Sopenharmony_ci	ret
30570af302Sopenharmony_ci1:	call 1f
31570af302Sopenharmony_ci	fld1
32570af302Sopenharmony_ci	fsubrp
33570af302Sopenharmony_ci	ret
34570af302Sopenharmony_ci
35570af302Sopenharmony_ci.global exp2l
36570af302Sopenharmony_ci.global __exp2l
37570af302Sopenharmony_ci.hidden __exp2l
38570af302Sopenharmony_ci.type exp2l,@function
39570af302Sopenharmony_ciexp2l:
40570af302Sopenharmony_ci__exp2l:
41570af302Sopenharmony_ci	fldt 4(%esp)
42570af302Sopenharmony_ci1:	sub $12,%esp
43570af302Sopenharmony_ci	fld %st(0)
44570af302Sopenharmony_ci	fstpt (%esp)
45570af302Sopenharmony_ci	mov 8(%esp),%ax
46570af302Sopenharmony_ci	and $0x7fff,%ax
47570af302Sopenharmony_ci	cmp $0x3fff+13,%ax
48570af302Sopenharmony_ci	jb 4f             # |x| < 8192
49570af302Sopenharmony_ci	cmp $0x3fff+15,%ax
50570af302Sopenharmony_ci	jae 3f            # |x| >= 32768
51570af302Sopenharmony_ci	fsts (%esp)
52570af302Sopenharmony_ci	cmpl $0xc67ff800,(%esp)
53570af302Sopenharmony_ci	jb 2f             # x > -16382
54570af302Sopenharmony_ci	movl $0x5f000000,(%esp)
55570af302Sopenharmony_ci	flds (%esp)       # 0x1p63
56570af302Sopenharmony_ci	fld %st(1)
57570af302Sopenharmony_ci	fsub %st(1)
58570af302Sopenharmony_ci	faddp
59570af302Sopenharmony_ci	fucomp %st(1)
60570af302Sopenharmony_ci	fnstsw
61570af302Sopenharmony_ci	sahf
62570af302Sopenharmony_ci	je 2f             # x - 0x1p63 + 0x1p63 == x
63570af302Sopenharmony_ci	movl $1,(%esp)
64570af302Sopenharmony_ci	flds (%esp)       # 0x1p-149
65570af302Sopenharmony_ci	fdiv %st(1)
66570af302Sopenharmony_ci	fstps (%esp)      # raise underflow
67570af302Sopenharmony_ci2:	fld1
68570af302Sopenharmony_ci	fld %st(1)
69570af302Sopenharmony_ci	frndint
70570af302Sopenharmony_ci	fxch %st(2)
71570af302Sopenharmony_ci	fsub %st(2)       # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
72570af302Sopenharmony_ci	f2xm1
73570af302Sopenharmony_ci	faddp             # 2^(x-rint(x))
74570af302Sopenharmony_ci1:	fscale
75570af302Sopenharmony_ci	fstp %st(1)
76570af302Sopenharmony_ci	add $12,%esp
77570af302Sopenharmony_ci	ret
78570af302Sopenharmony_ci3:	xor %eax,%eax
79570af302Sopenharmony_ci4:	cmp $0x3fff-64,%ax
80570af302Sopenharmony_ci	fld1
81570af302Sopenharmony_ci	jb 1b             # |x| < 0x1p-64
82570af302Sopenharmony_ci	fstpt (%esp)
83570af302Sopenharmony_ci	fistl 8(%esp)
84570af302Sopenharmony_ci	fildl 8(%esp)
85570af302Sopenharmony_ci	fsubrp %st(1)
86570af302Sopenharmony_ci	addl $0x3fff,8(%esp)
87570af302Sopenharmony_ci	f2xm1
88570af302Sopenharmony_ci	fld1
89570af302Sopenharmony_ci	faddp             # 2^(x-rint(x))
90570af302Sopenharmony_ci	fldt (%esp)       # 2^rint(x)
91570af302Sopenharmony_ci	fmulp
92570af302Sopenharmony_ci	add $12,%esp
93570af302Sopenharmony_ci	ret
94