xref: /netbsd/lib/libc/arch/x86_64/gen/fpgetsticky.S (revision c4a72b64)
1/*	$NetBSD: fpgetsticky.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $	*/
2
3/*
4 * Written by Frank van der Linden at Wasabi Systems for NetBSD.
5 * Public domain.
6 *
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
17WEAK_ALIAS(fpgetsticky, _fpgetsticky)
18ENTRY(_fpgetsticky)
19#else
20ENTRY(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
28