summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-11-14 09:51:26 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-11-14 09:51:26 +0000
commit2da93b274a8bcc303e3f1fe48abc44d50dff5d00 (patch)
treecd436edece88e14fe3c5207585e5d7a316d4abcd
parent4bfbb654e263cc09389d7b82637f43a1e6710a48 (diff)
Do not use fpu in the softfloat case. Fixes lib/libc/ieeefp/round
regress test; ok miod@
-rw-r--r--lib/libc/arch/sh/gen/flt_rounds.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/arch/sh/gen/flt_rounds.c b/lib/libc/arch/sh/gen/flt_rounds.c
index dcee4aeb078..e05754f4434 100644
--- a/lib/libc/arch/sh/gen/flt_rounds.c
+++ b/lib/libc/arch/sh/gen/flt_rounds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flt_rounds.c,v 1.1 2006/10/10 22:07:10 miod Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.2 2006/11/14 09:51:25 otto Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -30,8 +30,12 @@ static const int rndmap[] = {
int
__flt_rounds()
{
+#if !defined(SOFTFLOAT)
register_t fpscr;
__asm__ __volatile__ ("sts fpscr, %0" : "=r" (fpscr));
return rndmap[fpscr & 0x03];
+#else
+ return rndmap[fpgetround()];
+#endif
}