about summary refs log tree commit diff
path: root/src/math/i386/e_exp.s
blob: c50abc5ed33a5254df9324c4322b31aa4d7962f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.global expf
.type expf,@function
expf:
	mov 4(%esp),%eax
	flds 4(%esp)
	shr $23,%eax
	inc %al
	jz 1f
	jmp 0f

.global exp
.type exp,@function
exp:
	mov 8(%esp),%eax
	fldl 4(%esp)
	shl %eax
	cmp $0xffe00000,%eax
	jae 1f

0:	fldl2e
	fmulp
	fst %st(1)
	frndint
	fst %st(2)
	fsubrp
	f2xm1
	fld1
	faddp
	fscale
	fstp %st(1)
	ret

1:	fsts 4(%esp)
	cmpl $0xff800000,4(%esp)
	jnz 1f
	fstp %st(0)
	fldz
1:	ret