Update amd64 bits of libc's math routines
[dragonfly.git] / lib / libc / amd64 / gen / fpgetsticky.S
1 /*
2  * Written by Frank van der Linden at Wasabi Systems for NetBSD.
3  * Public domain.
4  *
5  * $NetBSD: fpgetsticky.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
6  * $DragonFly: src/lib/libc/amd64/gen/fpgetsticky.S,v 1.1 2006/07/27 00:46:57 corecode Exp $
7  */
8
9 #include <machine/asm.h>
10
11 /*
12  * XXX read both the x87 and SSE status words here, and OR
13  * them to get a complete picture of exceptions.
14  */
15
16 #ifdef WEAK_ALIAS
17 WEAK_ALIAS(fpgetsticky, _fpgetsticky)
18 ENTRY(_fpgetsticky)
19 #else
20 ENTRY(fpgetsticky)
21 #endif
22         fnstsw  -4(%rsp)
23         stmxcsr -8(%rsp)
24         movl    -4(%rsp),%eax
25         orl     -8(%rsp),%eax
26         andl    $63,%eax
27         ret