Home | History | Annotate | Line # | Download | only in gen
flt_rounds.S revision 1.1
      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 	.long 1		/* round to nearest */
     12 	.long 3		/* round to negative infinity */
     13 	.long 2		/* round to positive infinity */
     14 	.long 0		/* round to zero */
     15 
     16 ENTRY(__flt_rounds)
     17 	subl $4,%esp
     18 	fnstcw 2(%esp)
     19 	movw 2(%esp),%ax
     20 	shrl $10,%eax
     21 	andl $3,%eax
     22 	movl _map(,%eax,4),%eax
     23 	addl $4,%esp
     24 	ret
     25