Expand PMF_FN_* macros.
[netbsd-mini2440.git] / lib / libc / arch / i386 / gen / flt_rounds.S
blob479a7aa1c2fd3b23110c4431c60cb956422db4f2
1 /*      $NetBSD: flt_rounds.S,v 1.5 1998/01/09 03:45:03 perry Exp $     */
3 /*
4  * Written by J.T. Conklin, Apr 4, 1995
5  * Public domain.
6  */
8 #include <machine/asm.h>
10         .text
11         _ALIGN_TEXT
12 _map:
13         .byte 1         /* round to nearest */
14         .byte 3         /* round to negative infinity */
15         .byte 2         /* round to positive infinity */
16         .byte 0         /* round to zero */
18 ENTRY(__flt_rounds)
19         subl $4,%esp
20         fnstcw (%esp)
21         movl (%esp),%eax
22         shrl $10,%eax
23         andl $3,%eax
24 #ifdef PIC
25         PIC_PROLOGUE
26         leal PIC_GOTOFF(_map),%ecx
27         PIC_EPILOGUE
28         movb (%ecx,%eax,1),%al
29 #else
30         movb _map(,%eax,1),%al
31 #endif
32         addl $4,%esp
33         ret