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