summaryrefslogtreecommitdiff
path: root/src/math/i386/hypotf.s
blob: 068935e2d3466e714d53de737daed042a28c8827 (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
.global hypotf
.type hypotf,@function
hypotf:
	mov 4(%esp),%eax
	mov 8(%esp),%ecx
	add %eax,%eax
	add %ecx,%ecx
	and %eax,%ecx
	cmp $0xff000000,%ecx
	jae 2f
	test %eax,%eax
	jnz 1f
	flds 8(%esp)
	fabs
	ret
1:	mov 8(%esp),%eax
	add %eax,%eax
	jnz 1f
	flds 4(%esp)
	fabs
	ret
1:	flds 4(%esp)
	fld %st(0)
	fmulp
	flds 8(%esp)
	fld %st(0)
	fmulp
	faddp
	fsqrt
	ret
2:	cmp $0xff000000,%eax
	jnz 1f
	flds 4(%esp)
	fabs
	ret
1:	mov 8(%esp),%eax
	add %eax,%eax
	cmp $0xff000000,%eax
	flds 8(%esp)
	jnz 1f
	fabs
1:	ret