1/*	$OpenBSD: fpgetsticky.S,v 1.3 2018/07/03 23:14:05 mortimer 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	RETGUARD_SETUP(fpgetsticky, r11)
24	fnstsw	-4(%rsp)
25	stmxcsr	-8(%rsp)
26	movl	-4(%rsp),%eax
27	orl	-8(%rsp),%eax
28	andl	$63,%eax
29	RETGUARD_CHECK(fpgetsticky, r11)
30	ret
31#ifdef WEAK_ALIAS
32END(_fpgetsticky)
33#else
34END(fpgetsticky)
35#endif
36