xref: /haiku/src/system/libroot/posix/musl/math/x86/sqrt.s (revision 21258e2674226d6aa732321b6f8494841895af5f)
1.global sqrt
2.type sqrt,@function
3sqrt:	fldl 4(%esp)
4	fsqrt
5	fnstsw %ax
6	sub $12,%esp
7	fld %st(0)
8	fstpt (%esp)
9	mov (%esp),%ecx
10	and $0x7ff,%ecx
11	cmp $0x400,%ecx
12	jnz 1f
13	and $0x200,%eax
14	sub $0x100,%eax
15	sub %eax,(%esp)
16	fstp %st(0)
17	fldt (%esp)
181:	add $12,%esp
19	fstpl 4(%esp)
20	fldl 4(%esp)
21	ret
22