1*0a6a1f1dSLionel Sambuc/* $NetBSD: fpgetround.S,v 1.7 2014/05/23 02:34:19 uebayasi Exp $ */ 22fe8fb19SBen Gras 32fe8fb19SBen Gras/* 42fe8fb19SBen Gras * Written by J.T. Conklin, Apr 4, 1995 52fe8fb19SBen Gras * Public domain. 62fe8fb19SBen Gras */ 72fe8fb19SBen Gras 82fe8fb19SBen Gras#include <machine/asm.h> 92fe8fb19SBen Gras 10f14fb602SLionel Sambuc/* 11f14fb602SLionel Sambuc * XXX load only x87 state. 12f14fb602SLionel Sambuc */ 13f14fb602SLionel Sambuc 142fe8fb19SBen Gras#ifdef WEAK_ALIAS 152fe8fb19SBen GrasWEAK_ALIAS(fpgetround, _fpgetround) 162fe8fb19SBen GrasENTRY(_fpgetround) 172fe8fb19SBen Gras#else 182fe8fb19SBen GrasENTRY(fpgetround) 192fe8fb19SBen Gras#endif 20f14fb602SLionel Sambuc fnstcw -4(%esp) 21f14fb602SLionel Sambuc movl -4(%esp), %eax 22f14fb602SLionel Sambuc andl $0x00000c00, %eax 232fe8fb19SBen Gras ret 24*0a6a1f1dSLionel Sambuc#ifdef WEAK_ALIAS 25*0a6a1f1dSLionel SambucEND(_fpgetround) 26*0a6a1f1dSLionel Sambuc#else 27*0a6a1f1dSLionel SambucEND(fpgetround) 28*0a6a1f1dSLionel Sambuc#endif 29