1 /* $NetBSD: flt_rounds.c,v 1.6 2010/09/03 17:22:51 matt Exp $ */
4 * Written by J.T. Conklin, Apr 11, 1995
9 #if defined(LIBC_SCCS) && !defined(lint)
10 __RCSID("$NetBSD: flt_rounds.c,v 1.6 2010/09/03 17:22:51 matt Exp $");
11 #endif /* LIBC_SCCS and not lint */
13 #include <machine/float.h>
16 static const int map
[] = {
17 1, /* round to nearest */
18 0, /* round to zero */
19 2, /* round to positive infinity */
20 3 /* round to negative infinity */
26 #ifdef SOFTFLOAT_FOR_GCC
27 return map
[fpgetround()];
31 __asm("cfc1\t%0,$31" : "=r" (x
));