flt_rounds.S revision 1.4 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 #ifdef PIC
23 PIC_PROLOGUE
24 leal PIC_GOTOFF(_map),%ecx
25 PIC_EPILOGUE
26 movb (%ecx,%eax,1),%al
27 #else
28 movb _map(,%eax,1),%al
29 #endif
30 addl $4,%esp
31 ret
32