Home | History | Annotate | Line # | Download | only in gen
flt_rounds.S revision 1.3
      1 /*
      2  * Written by J.T. Conklin, Apr 4, 1995
      3  * Public domain.
      4  */
      5 
      6 #include <machine/asm.h>
      7 
      8 	.text
      9 	.align 2
     10 _map:
     11 	.byte 1		/* round to nearest */
     12 	.byte 3		/* round to negative infinity */
     13 	.byte 2		/* round to positive infinity */
     14 	.byte 0		/* round to zero */
     15 
     16 ENTRY(__flt_rounds)
     17 	subl $4,%esp
     18 	fnstcw (%esp)
     19 	movl (%esp),%eax
     20 	shrl $10,%eax
     21 	andl $3,%eax
     22 	movb _map(,%eax,1),%al
     23 	addl $4,%esp
     24 	ret
     25