1 /* $NetBSD: fpgetmask.S,v 1.4 2014/05/22 15:01:56 uebayasi Exp $ */ 2 3 /* 4 * Written by J.T. Conklin, Apr 4, 1995 5 * Public domain. 6 */ 7 8 #include <machine/asm.h> 9 10 /* 11 * XXX only read x87 control word here. If an application only 12 * uses the fp* interface to manipulate FP bits, it should 13 * always remain in sync with the SSE mxcsr register. 14 */ 15 16 #ifdef WEAK_ALIAS 17 WEAK_ALIAS(fpgetmask, _fpgetmask) 18 ENTRY(_fpgetmask) 19 #else 20 ENTRY(fpgetmask) 21 #endif 22 fnstcw -4(%rsp) 23 movl -4(%rsp),%eax 24 notl %eax 25 andl $63,%eax 26 ret 27 #ifdef WEAK_ALIAS 28 END(_fpgetmask) 29 #else 30 END(fpgetmask) 31 #endif 32