8c168760ce576ecb1d8380aaf9640d3439686bf0
[dragonfly.git] / lib / libc / amd64 / gen / fpgetmask.S
1 /*
2  * Written by J.T. Conklin, Apr 4, 1995
3  * Public domain.
4  *
5  * $NetBSD: fpgetmask.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
6  * $DragonFly: src/lib/libc/amd64/gen/fpgetmask.S,v 1.1 2006/07/27 00:46:57 corecode Exp $
7  */
8
9 #include <machine/asm.h>
10
11 /*
12  * XXX only read x87 control word here. If an application only
13  * uses the fp* interface to manipulate FP bits, it should
14  * always remain in sync with the SSE mxcsr register.
15  */
16
17 #ifdef WEAK_ALIAS
18 WEAK_ALIAS(fpgetmask, _fpgetmask)
19 ENTRY(_fpgetmask)
20 #else
21 ENTRY(fpgetmask)
22 #endif
23         fnstcw -4(%rsp)
24         movl -4(%rsp),%eax
25         notl %eax
26         andl $63,%eax
27         ret