xref: /netbsd-src/lib/libc/arch/x86_64/gen/fpgetsticky.S (revision 92d1d4411b9f8cbaff3d5eb0b336fcc1c32deb29)
1/*	$NetBSD: fpgetsticky.S,v 1.4 2014/05/22 15:01:56 uebayasi 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#ifdef WEAK_ALIAS
29END(_fpgetsticky)
30#else
31END(fpgetsticky)
32#endif
33