Home | History | Annotate | Line # | Download | only in gen
fpsetround.S revision 1.1
      1  1.1  mycroft /*
      2  1.1  mycroft  * Written by Charles M. Hannum, Apr 9, 1995
      3  1.1  mycroft  * Public domain.
      4  1.1  mycroft  */
      5  1.1  mycroft 
      6  1.1  mycroft #include <machine/asm.h>
      7  1.1  mycroft 
      8  1.1  mycroft ENTRY(fpsetround)
      9  1.1  mycroft 	subl $4,%esp
     10  1.1  mycroft 
     11  1.1  mycroft 	fnstcw (%esp)
     12  1.1  mycroft 	movl (%esp),%eax
     13  1.1  mycroft 
     14  1.1  mycroft 	rorl $10,%eax
     15  1.1  mycroft 	movl %eax,%edx
     16  1.1  mycroft 	andl $3,%eax
     17  1.1  mycroft 
     18  1.1  mycroft 	subl %eax,%edx
     19  1.1  mycroft 	movl 8(%esp),%ecx
     20  1.1  mycroft 	andl $3,%ecx
     21  1.1  mycroft 	orl %ecx,%edx
     22  1.1  mycroft 	roll $10,%edx
     23  1.1  mycroft 	movl %edx,(%esp)
     24  1.1  mycroft 	fldcw (%esp)
     25  1.1  mycroft 
     26  1.1  mycroft 	addl $4,%esp
     27  1.1  mycroft 	ret
     28