summaryrefslogtreecommitdiff
path: root/lib/libc/arch/sparc64/gen/fpgetround.c
blob: 76f3595263128866a4e72127bb119138c3a772d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*	$OpenBSD: fpgetround.c,v 1.2 2016/07/26 19:07:09 guenther Exp $	*/

/*
 * Written by J.T. Conklin, Apr 10, 1995
 * Public domain.
 */

#include <ieeefp.h>

fp_rnd
fpgetround(void)
{
	int x;

	__asm__("st %%fsr,%0" : "=m" (*&x));
	return (x >> 30) & 0x03;
}
DEF_WEAK(fpgetround);