about summary refs log tree commit diff
path: root/src/math/i386/expm1.s
blob: bbb5d12eae7dee1715751e64fdf82c0e5bd1ff8f (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
39
40
41
42
43
44
45
46
47
.global expm1f
.type expm1f,@function
expm1f:
	flds 4(%esp)
	jmp 1f

.global expm1l
.type expm1l,@function
expm1l:
	fldt 4(%esp)
	jmp 1f

.global expm1
.type expm1,@function
expm1:
	fldl 4(%esp)
1:	fxam
	fnstsw %ax
	sahf
	jnp 1f
	jnc 1f
	fstps 4(%esp)
	mov $0xfe,%al
	and %al,7(%esp)
	flds 4(%esp)
1:	fldl2e
	fmulp
	fld %st(0)
	frndint
	fldz
	fcomp
	fnstsw %ax
	sahf
	jnz 1f
	fstp %st(0)
	f2xm1
	ret
1:	fxch %st(1)
	fsub %st(1)
	f2xm1
	fld1
	faddp
	fscale
	fld1
	fsubrp
	fstp %st(1)
	ret