blob: 7a6e621a10b8bed64d0697449208ac0a62846457 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/*
* Written by Charles M. Hannum, Apr 9, 1995
* Public domain.
*/
#include <machine/asm.h>
ENTRY(fpsetround)
subl $4,%esp
fnstcw (%esp)
movl (%esp),%eax
rorl $10,%eax
movl %eax,%edx
andl $3,%eax
subl %eax,%edx
movl 8(%esp),%ecx
andl $3,%ecx
orl %ecx,%edx
roll $10,%edx
movl %edx,(%esp)
fldcw (%esp)
addl $4,%esp
ret
|