summaryrefslogtreecommitdiff
path: root/lib/libm/arch/hppa/s_rint.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libm/arch/hppa/s_rint.c')
-rw-r--r--lib/libm/arch/hppa/s_rint.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libm/arch/hppa/s_rint.c b/lib/libm/arch/hppa/s_rint.c
new file mode 100644
index 00000000000..101b62c9db0
--- /dev/null
+++ b/lib/libm/arch/hppa/s_rint.c
@@ -0,0 +1,17 @@
+/*
+ * Written by Michael Shalayeff. Public Domain
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: s_rint.c,v 1.1 2002/05/22 21:34:56 mickey Exp $";
+#endif
+
+#include "math.h"
+
+double
+__ieee754_rint(double x)
+{
+ __asm__ __volatile__("frnd,dbl %0,%0" : "+f" (x));
+
+ return (x);
+}