1178580Simp/* $NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ 2178580Simp 3178580Simp/* 4178580Simp * Written by J.T. Conklin, Apr 11, 1995 5178580Simp * Public domain. 6178580Simp */ 7178580Simp 8178580Simp#include <sys/cdefs.h> 9178580Simp__FBSDID("$FreeBSD$"); 10178580Simp#if defined(LIBC_SCCS) && !defined(lint) 11178580Simp__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); 12178580Simp#endif /* LIBC_SCCS and not lint */ 13178580Simp 14178580Simp#include "namespace.h" 15178580Simp 16178580Simp#include <ieeefp.h> 17178580Simp 18178580Simp#ifdef __weak_alias 19178580Simp__weak_alias(fpgetround,_fpgetround) 20178580Simp#endif 21178580Simp 22178580Simpfp_rnd_t 23178580Simpfpgetround() 24178580Simp{ 25178580Simp int x; 26178580Simp 27178580Simp __asm("cfc1 %0,$31" : "=r" (x)); 28178580Simp return x & 0x03; 29178580Simp} 30