flt_rounds.S revision 1.4 1 1.1 jtc /*
2 1.1 jtc * Written by J.T. Conklin, Apr 4, 1995
3 1.1 jtc * Public domain.
4 1.1 jtc */
5 1.1 jtc
6 1.1 jtc #include <machine/asm.h>
7 1.1 jtc
8 1.1 jtc .text
9 1.1 jtc .align 2
10 1.1 jtc _map:
11 1.2 mycroft .byte 1 /* round to nearest */
12 1.2 mycroft .byte 3 /* round to negative infinity */
13 1.2 mycroft .byte 2 /* round to positive infinity */
14 1.2 mycroft .byte 0 /* round to zero */
15 1.1 jtc
16 1.1 jtc ENTRY(__flt_rounds)
17 1.1 jtc subl $4,%esp
18 1.2 mycroft fnstcw (%esp)
19 1.3 mycroft movl (%esp),%eax
20 1.1 jtc shrl $10,%eax
21 1.1 jtc andl $3,%eax
22 1.4 pk #ifdef PIC
23 1.4 pk PIC_PROLOGUE
24 1.4 pk leal PIC_GOTOFF(_map),%ecx
25 1.4 pk PIC_EPILOGUE
26 1.4 pk movb (%ecx,%eax,1),%al
27 1.4 pk #else
28 1.2 mycroft movb _map(,%eax,1),%al
29 1.4 pk #endif
30 1.1 jtc addl $4,%esp
31 1.1 jtc ret
32