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