8579151e4b
fpsetround(), fpsetsticky(), obtained from NetBSD and tweaked a little to use definitions from machine/fsr.h instead of magic numbers.
22 lines
344 B
C
22 lines
344 B
C
/* $NetBSD: fpgetround.c,v 1.2 2002/01/13 21:45:50 thorpej Exp $ */
|
|
|
|
/*
|
|
* Written by J.T. Conklin, Apr 10, 1995
|
|
* Public domain.
|
|
*/
|
|
|
|
#include <sys/cdefs.h>
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
#include <machine/fsr.h>
|
|
#include <ieeefp.h>
|
|
|
|
fp_rnd_t
|
|
fpgetround()
|
|
{
|
|
unsigned int x;
|
|
|
|
__asm__("st %%fsr,%0" : "=m" (x));
|
|
return ((fp_rnd_t)FSR_GET_RD(x));
|
|
}
|