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