xref: /haiku/src/system/libroot/posix/musl/math/x86/hypotf.s (revision f504f61099b010fbfa94b1cc63d2e9072c7f7185)
1*f504f610SAugustin Cavalier.global hypotf
2*f504f610SAugustin Cavalier.type hypotf,@function
3*f504f610SAugustin Cavalierhypotf:
4*f504f610SAugustin Cavalier	mov 4(%esp),%eax
5*f504f610SAugustin Cavalier	mov 8(%esp),%ecx
6*f504f610SAugustin Cavalier	add %eax,%eax
7*f504f610SAugustin Cavalier	add %ecx,%ecx
8*f504f610SAugustin Cavalier	and %eax,%ecx
9*f504f610SAugustin Cavalier	cmp $0xff000000,%ecx
10*f504f610SAugustin Cavalier	jae 2f
11*f504f610SAugustin Cavalier	test %eax,%eax
12*f504f610SAugustin Cavalier	jnz 1f
13*f504f610SAugustin Cavalier	flds 8(%esp)
14*f504f610SAugustin Cavalier	fabs
15*f504f610SAugustin Cavalier	ret
16*f504f610SAugustin Cavalier1:	mov 8(%esp),%eax
17*f504f610SAugustin Cavalier	add %eax,%eax
18*f504f610SAugustin Cavalier	jnz 1f
19*f504f610SAugustin Cavalier	flds 4(%esp)
20*f504f610SAugustin Cavalier	fabs
21*f504f610SAugustin Cavalier	ret
22*f504f610SAugustin Cavalier1:	flds 4(%esp)
23*f504f610SAugustin Cavalier	fld %st(0)
24*f504f610SAugustin Cavalier	fmulp
25*f504f610SAugustin Cavalier	flds 8(%esp)
26*f504f610SAugustin Cavalier	fld %st(0)
27*f504f610SAugustin Cavalier	fmulp
28*f504f610SAugustin Cavalier	faddp
29*f504f610SAugustin Cavalier	fsqrt
30*f504f610SAugustin Cavalier	ret
31*f504f610SAugustin Cavalier2:	cmp $0xff000000,%eax
32*f504f610SAugustin Cavalier	jnz 1f
33*f504f610SAugustin Cavalier	flds 4(%esp)
34*f504f610SAugustin Cavalier	fabs
35*f504f610SAugustin Cavalier	ret
36*f504f610SAugustin Cavalier1:	mov 8(%esp),%eax
37*f504f610SAugustin Cavalier	add %eax,%eax
38*f504f610SAugustin Cavalier	cmp $0xff000000,%eax
39*f504f610SAugustin Cavalier	flds 8(%esp)
40*f504f610SAugustin Cavalier	jnz 1f
41*f504f610SAugustin Cavalier	fabs
42*f504f610SAugustin Cavalier1:	ret
43