Initial import from FreeBSD RELENG_4:
[dragonfly.git] / lib / libc / mips / gen / fpgetround.c
1 /*
2  * Written by J.T. Conklin, Apr 11, 1995
3  * Public domain.
4  */
5
6 #if defined(LIBC_SCCS) && !defined(lint)
7 static char rcsid[] = "$OpenBSD$";
8 #endif /* LIBC_SCCS and not lint */
9
10 #include <ieeefp.h>
11
12 fp_rnd
13 fpgetround()
14 {
15         int x;
16
17         __asm__("cfc1 %0,$31" : "=r" (x));
18         return x & 0x03;
19 }