1/* $OpenBSD: fpgetsticky.S,v 1.2 2015/05/29 08:50:12 uebayasi 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#ifdef WEAK_ALIAS 30END(_fpgetsticky) 31#else 32END(fpgetsticky) 33#endif 34