xref: /netbsd-src/lib/libc/arch/i386/gen/fpsetsticky.S (revision 0d34bfa26d596b4f9bcb49175a92020d91572850)
1*0d34bfa2Suebayasi/*	$NetBSD: fpsetsticky.S,v 1.7 2014/05/23 02:34:19 uebayasi Exp $	*/
2a3a46419Sperry
310b402aaSmycroft/*
410b402aaSmycroft * Written by Charles M. Hannum, Apr 9, 1995
510b402aaSmycroft * Public domain.
610b402aaSmycroft */
710b402aaSmycroft
810b402aaSmycroft#include <machine/asm.h>
910b402aaSmycroft
105d3e8294Sthorpej#ifdef WEAK_ALIAS
115d3e8294SthorpejWEAK_ALIAS(fpsetsticky, _fpsetsticky)
125d3e8294SthorpejENTRY(_fpsetsticky)
135d3e8294Sthorpej#else
1410b402aaSmycroftENTRY(fpsetsticky)
155d3e8294Sthorpej#endif
1642d9c8afSmycroft	subl $28,%esp
1710b402aaSmycroft
1842d9c8afSmycroft	fnstenv (%esp)
1942d9c8afSmycroft	movl 4(%esp),%eax
2010b402aaSmycroft	movl %eax,%edx
2110b402aaSmycroft
2210b402aaSmycroft	andl $63,%eax
2310b402aaSmycroft
2465a1322cSmycroft	subl %eax,%edx
2542d9c8afSmycroft	movl 32(%esp),%ecx
2610b402aaSmycroft	andl $63,%ecx
2765a1322cSmycroft	addl %ecx,%edx
2842d9c8afSmycroft	movl %edx,4(%esp)
2942d9c8afSmycroft	fldenv (%esp)
3010b402aaSmycroft
3142d9c8afSmycroft	addl $28,%esp
3210b402aaSmycroft	ret
33*0d34bfa2Suebayasi#ifdef WEAK_ALIAS
34*0d34bfa2SuebayasiEND(_fpsetsticky)
35*0d34bfa2Suebayasi#else
36*0d34bfa2SuebayasiEND(fpsetsticky)
37*0d34bfa2Suebayasi#endif
38