1 /* $OpenBSD: fpgetround.c,v 1.3 2016/07/26 19:07:09 guenther Exp $ */ 2 /* 3 * Written by J.T. Conklin, Apr 11, 1995 4 * Public domain. 5 */ 6 7 #include <ieeefp.h> 8 9 fp_rnd 10 fpgetround(void) 11 { 12 int x; 13 14 __asm__("cfc1 %0,$31" : "=r" (x)); 15 return x & 0x03; 16 } 17 DEF_WEAK(fpgetround); 18