Home | History | Annotate | Line # | Download | only in gen
fpgetround.S revision 1.4.18.1
      1  1.4.18.1       tls /*	$NetBSD: fpgetround.S,v 1.4.18.1 2014/08/10 06:51:49 tls 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.4  christos  * XXX load only x87 state. If an application only uses the fp*
     12       1.3      fvdl  * interface, this should be in sync with the SSE mxcsr register.
     13       1.3      fvdl  */
     14       1.1      fvdl 
     15       1.2   thorpej #ifdef WEAK_ALIAS
     16       1.2   thorpej WEAK_ALIAS(fpgetround, _fpgetround)
     17       1.2   thorpej ENTRY(_fpgetround)
     18       1.2   thorpej #else
     19       1.1      fvdl ENTRY(fpgetround)
     20       1.2   thorpej #endif
     21       1.1      fvdl 	fnstcw -4(%rsp)
     22       1.4  christos 	movl -4(%rsp), %eax
     23       1.4  christos 	andl $0x00000c00, %eax
     24       1.1      fvdl 	ret
     25  1.4.18.1       tls #ifdef WEAK_ALIAS
     26  1.4.18.1       tls END(_fpgetround)
     27  1.4.18.1       tls #else
     28  1.4.18.1       tls END(fpgetround)
     29  1.4.18.1       tls #endif
     30