Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / lib / libc / i386 / gen / fpsetsticky.S
1 /*
2  * Written by Charles M. Hannum, Apr 9, 1995
3  * Public domain.
4  *
5  * $NetBSD: fpsetsticky.S,v 1.6 2002/01/13 21:45:43 thorpej Exp $
6  * $DragonFly: src/lib/libc/i386/gen/fpsetsticky.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
7  */
8
9 #include <machine/asm.h>
10
11 #ifdef WEAK_ALIAS
12 WEAK_ALIAS(fpsetsticky, _fpsetsticky)
13 ENTRY(_fpsetsticky)
14 #else
15 ENTRY(fpsetsticky)
16 #endif
17         subl $28,%esp
18
19         fnstenv (%esp)
20         movl 4(%esp),%eax
21         movl %eax,%edx
22
23         andl $63,%eax
24
25         subl %eax,%edx
26         movl 32(%esp),%ecx
27         andl $63,%ecx
28         addl %ecx,%edx
29         movl %edx,4(%esp)
30         fldenv (%esp)
31
32         addl $28,%esp
33         ret