Home | History | Annotate | Line # | Download | only in gen
fpsetround.S revision 1.3
      1  1.3  thorpej /*	$NetBSD: fpsetround.S,v 1.3 2002/01/13 21:45:43 thorpej Exp $	*/
      2  1.2    perry 
      3  1.1  mycroft /*
      4  1.1  mycroft  * Written by Charles M. Hannum, Apr 9, 1995
      5  1.1  mycroft  * Public domain.
      6  1.1  mycroft  */
      7  1.1  mycroft 
      8  1.1  mycroft #include <machine/asm.h>
      9  1.1  mycroft 
     10  1.3  thorpej #ifdef WEAK_ALIAS
     11  1.3  thorpej WEAK_ALIAS(fpsetround, _fpsetround)
     12  1.3  thorpej ENTRY(_fpsetround)
     13  1.3  thorpej #else
     14  1.1  mycroft ENTRY(fpsetround)
     15  1.3  thorpej #endif
     16  1.1  mycroft 	subl $4,%esp
     17  1.1  mycroft 
     18  1.1  mycroft 	fnstcw (%esp)
     19  1.1  mycroft 	movl (%esp),%eax
     20  1.1  mycroft 
     21  1.1  mycroft 	rorl $10,%eax
     22  1.1  mycroft 	movl %eax,%edx
     23  1.1  mycroft 	andl $3,%eax
     24  1.1  mycroft 
     25  1.1  mycroft 	subl %eax,%edx
     26  1.1  mycroft 	movl 8(%esp),%ecx
     27  1.1  mycroft 	andl $3,%ecx
     28  1.1  mycroft 	orl %ecx,%edx
     29  1.1  mycroft 	roll $10,%edx
     30  1.1  mycroft 	movl %edx,(%esp)
     31  1.1  mycroft 	fldcw (%esp)
     32  1.1  mycroft 
     33  1.1  mycroft 	addl $4,%esp
     34  1.1  mycroft 	ret
     35