summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-11-14 09:51:25 +0000
committerotto <otto@openbsd.org>2006-11-14 09:51:25 +0000
commite3bd70a6e66d4a4d2eaca5b230c6251a5764bb4c (patch)
tree2b09a77867f931f095b67d9267634172e029bbe4
parentadd this, so version compiles... (diff)
downloadwireguard-openbsd-e3bd70a6e66d4a4d2eaca5b230c6251a5764bb4c.tar.xz
wireguard-openbsd-e3bd70a6e66d4a4d2eaca5b230c6251a5764bb4c.zip
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 d68539d30f2..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.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
}