summaryrefslogtreecommitdiff
path: root/src/math/i386/remquo.s
blob: 86ae2dc342e0e1a5b56980d3942afb40b25bb9b0 (plain)
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
.global remquof
.type remquof,@function
remquof:
	mov 12(%esp),%ecx
	fldl 4(%esp)
	fldl 8(%esp)
	jmp 1f

.global remquol
.type remquol,@function
remquol:
	mov 28(%esp),%ecx
	fldl 4(%esp)
	fldl 16(%esp)
	jmp 1f

.global remquo
.type remquo,@function
remquo:
	mov 20(%esp),%ecx
	fldl 4(%esp)
	fldl 12(%esp)
1:	fld %st(1)
1:      fprem1
	fnstsw %ax
	sahf
	jp 1b
	fsubr %st(0),%st(2)
	fxch %st(2)
	fdivp
	mov $0x4f000000,%eax
	mov %eax,4(%esp)
	flds 4(%esp)
	fxch %st(1)
1:	fprem
	fnstsw %ax
	sahf
	jp 1b
	fistpl (%ecx)
	fstp %st(0)
	ret