fpsetsticky.S revision 1.3 1 /* $NetBSD: fpsetsticky.S,v 1.3 2002/06/12 19:17:23 fvdl Exp $ */
2
3 /*
4 * Written by Frank van der Linden at Wasabi Systems for NetBSD
5 * Public domain.
6 */
7
8 #include <machine/asm.h>
9
10 /*
11 * XXX set both the x87 status word and the SSE mxcsr register.
12 * Applications should only set exception and round flags
13 * via the fp*() interface, otherwise the status words
14 * will get our of sync.
15 */
16
17
18 #ifdef WEAK_ALIAS
19 WEAK_ALIAS(fpsetsticky, _fpsetsticky)
20 ENTRY(_fpsetsticky)
21 #else
22 ENTRY(fpsetsticky)
23 #endif
24 fnstenv -28(%rsp)
25 stmxcsr -32(%rsp)
26
27 andl $63,%edi
28
29 movl -24(%rsp),%eax
30 movl %eax,%edx
31 andl $63,%eax
32
33 orl %edi,%edx
34 movl %edx,-24(%rsp)
35
36 movl -32(%rsp),%edx
37 orl %edi,%edx
38 movl %edx,-32(%rsp)
39
40 ldmxcsr -32(%rsp)
41 fldenv -28(%rsp)
42 ret
43