summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/mips64/gen/fpgetround.c
blob: 5507197839143d0d2f77e846b2360b52f07959fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*	$OpenBSD: fpgetround.c,v 1.3 2016/07/26 19:07:09 guenther Exp $ */
/*
 * Written by J.T. Conklin, Apr 11, 1995
 * Public domain.
 */

#include <ieeefp.h>

fp_rnd
fpgetround(void)
{
	int x;

	__asm__("cfc1 %0,$31" : "=r" (x));
	return x & 0x03;
}
DEF_WEAK(fpgetround);