xref: /netbsd/lib/libc/arch/i386/gen/fpsetmask.S (revision bf9ec67e)
1/*	$NetBSD: fpsetmask.S,v 1.4 2002/01/13 21:45:43 thorpej Exp $	*/
2
3/*
4 * Written by Charles M. Hannum, Apr 9, 1995
5 * Public domain.
6 */
7
8#include <machine/asm.h>
9
10#ifdef WEAK_ALIAS
11WEAK_ALIAS(fpsetmask, _fpsetmask)
12ENTRY(_fpsetmask)
13#else
14ENTRY(fpsetmask)
15#endif
16	subl $4,%esp
17
18	fnstcw (%esp)
19	movl (%esp),%eax
20	movl %eax,%edx
21
22	notl %eax
23	andl $63,%eax
24
25	addl %eax,%edx
26	movl 8(%esp),%ecx
27	andl $63,%ecx
28	subl %ecx,%edx
29	movl %edx,(%esp)
30	fldcw (%esp)
31
32	addl $4,%esp
33	ret
34