1/* $NetBSD: fpsetprec.S,v 1.1 2011/03/26 19:51:41 christos 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(fpsetprec, _fpsetprec) 12ENTRY(_fpsetprec) 13#else 14ENTRY(fpsetprec) 15#endif 16 subl $4,%esp 17 18 fnstcw (%esp) 19 movl (%esp),%eax 20 21 rorl $8,%eax 22 movl %eax,%edx 23 andl $3,%eax 24 25 subl %eax,%edx 26 movl 8(%esp),%ecx 27 andl $3,%ecx 28 orl %ecx,%edx 29 roll $8,%edx 30 movl %edx,(%esp) 31 fldcw (%esp) 32 33 addl $4,%esp 34 ret 35