xref: /openbsd-src/lib/libc/arch/amd64/gen/fpgetsticky.S (revision 2b0358df1d88d06ef4139321dd05bd5e05d91eaf)
1/*	$OpenBSD: fpgetsticky.S,v 1.1 2004/01/28 01:44:45 mickey Exp $	*/
2/*	$NetBSD: fpgetsticky.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $	*/
3
4/*
5 * Written by Frank van der Linden at Wasabi Systems for NetBSD.
6 * Public domain.
7 *
8 */
9
10#include <machine/asm.h>
11
12/*
13 * XXX read both the x87 and SSE status words here, and OR
14 * them to get a complete picture of exceptions.
15 */
16
17#ifdef WEAK_ALIAS
18WEAK_ALIAS(fpgetsticky, _fpgetsticky)
19ENTRY(_fpgetsticky)
20#else
21ENTRY(fpgetsticky)
22#endif
23	fnstsw	-4(%rsp)
24	stmxcsr	-8(%rsp)
25	movl	-4(%rsp),%eax
26	orl	-8(%rsp),%eax
27	andl	$63,%eax
28	ret
29