1 /* $NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
4 * Written by J.T. Conklin, Apr 11, 1995
10 #if defined(LIBC_SCCS) && !defined(lint)
11 __RCSID("$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
12 #endif /* LIBC_SCCS and not lint */
17 #ifdef __mips_soft_float
18 #include "softfloat-for-gcc.h"
20 #include "softfloat.h"
23 static const int map[] = {
24 1, /* round to nearest */
25 0, /* round to zero */
26 2, /* round to positive infinity */
27 3 /* round to negative infinity */
35 #ifdef __mips_soft_float
36 mode = __softfloat_float_rounding_mode;
38 __asm __volatile("cfc1 %0,$31" : "=r" (mode));
41 return map[mode & 0x03];