xref: /openbsd-src/lib/libc/arch/hppa/gen/fpgetround.c (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1 /*	$OpenBSD: fpgetround.c,v 1.3 2002/10/21 18:41:05 mickey Exp $	*/
2 
3 /*
4  * Written by Miodrag Vallat.  Public domain
5  */
6 
7 #include <sys/types.h>
8 #include <ieeefp.h>
9 
10 fp_rnd
11 fpgetround()
12 {
13 	u_int64_t fpsr;
14 
15 	__asm__ __volatile__("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr));
16 	return ((fpsr >> 41) & 0x3);
17 }
18