Revert "rename amd64 architecture to x86_64"
[dragonfly.git] / lib / libc / amd64 / gen / fpgetround.S
1 /*
2  * Written by J.T. Conklin, Apr 4, 1995
3  * Public domain.
4  *
5  * $NetBSD: fpgetround.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $
6  * $DragonFly: src/lib/libc/amd64/gen/fpgetround.S,v 1.1 2006/07/27 00:46:57 corecode Exp $
7  */
8
9 #include <machine/asm.h>
10
11 /*
12  * XXX store only x87 state. If an application only uses the fp*
13  * interface, this should be in sync with the SSE mxcsr register.
14  */
15
16 #ifdef WEAK_ALIAS
17 WEAK_ALIAS(fpgetround, _fpgetround)
18 ENTRY(_fpgetround)
19 #else
20 ENTRY(fpgetround)
21 #endif
22         fnstcw -4(%rsp)
23         movl -4(%rsp),%eax
24         rorl $10,%eax
25         andl $3,%eax
26         ret