xref: /openbsd/lib/libc/arch/m88k/gen/fpgetround.c (revision 9b7c3dbb)
1 /*	$OpenBSD: fpgetround.c,v 1.5 2016/07/26 19:07:09 guenther Exp $	*/
2 
3 /*
4  * Written by J.T. Conklin, Apr 10, 1995
5  * Public domain.
6  * Ported to 88k by Nivas Madhur.
7  */
8 
9 #include <ieeefp.h>
10 
11 fp_rnd
12 fpgetround(void)
13 {
14 	int x;
15 
16 	__asm__ volatile ("fldcr %0, %%fcr63" : "=r" (x));
17 	return (x >> 14) & 0x03;
18 }
19 DEF_WEAK(fpgetround);
20