about summary refs log tree commit diff
path: root/src/math/i386/scalbn.s
blob: 8bf302f236bb09e829188e5f9ca344b39b73a694 (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
.global ldexp
.type ldexp,@function
ldexp:
	nop

.global scalbln
.type scalbln,@function
scalbln:
	nop

.global scalbn
.type scalbn,@function
scalbn:
	mov 12(%esp),%eax
	add $0x3ffe,%eax
	cmp $0x7ffd,%eax
	jb 1f
	sub $0x3ffe,%eax
	sar $31,%eax
	xor $0xfff,%eax
	add $0x3ffe,%eax
1:	inc %eax
	fldl 4(%esp)
	mov %eax,12(%esp)
	mov $0x80000000,%eax
	mov %eax,8(%esp)
	xor %eax,%eax
	mov %eax,4(%esp)
	fldt 4(%esp)
	fmulp
	fstpl 4(%esp)
	fldl 4(%esp)
	ret