fpsetround.S revision 1.2 1 1.2 perry /* $NetBSD: fpsetround.S,v 1.2 1998/01/09 03:45:06 perry Exp $ */
2 1.2 perry
3 1.1 mycroft /*
4 1.1 mycroft * Written by Charles M. Hannum, Apr 9, 1995
5 1.1 mycroft * Public domain.
6 1.1 mycroft */
7 1.1 mycroft
8 1.1 mycroft #include <machine/asm.h>
9 1.1 mycroft
10 1.1 mycroft ENTRY(fpsetround)
11 1.1 mycroft subl $4,%esp
12 1.1 mycroft
13 1.1 mycroft fnstcw (%esp)
14 1.1 mycroft movl (%esp),%eax
15 1.1 mycroft
16 1.1 mycroft rorl $10,%eax
17 1.1 mycroft movl %eax,%edx
18 1.1 mycroft andl $3,%eax
19 1.1 mycroft
20 1.1 mycroft subl %eax,%edx
21 1.1 mycroft movl 8(%esp),%ecx
22 1.1 mycroft andl $3,%ecx
23 1.1 mycroft orl %ecx,%edx
24 1.1 mycroft roll $10,%edx
25 1.1 mycroft movl %edx,(%esp)
26 1.1 mycroft fldcw (%esp)
27 1.1 mycroft
28 1.1 mycroft addl $4,%esp
29 1.1 mycroft ret
30