summaryrefslogtreecommitdiff
path: root/lib/libc/arch
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch')
-rw-r--r--lib/libc/arch/sh/Makefile.inc7
-rw-r--r--lib/libc/arch/sh/gen/Makefile.inc11
-rw-r--r--lib/libc/arch/sh/gen/fabs.c7
3 files changed, 19 insertions, 6 deletions
diff --git a/lib/libc/arch/sh/Makefile.inc b/lib/libc/arch/sh/Makefile.inc
index 48a20dc9573..9208472c09d 100644
--- a/lib/libc/arch/sh/Makefile.inc
+++ b/lib/libc/arch/sh/Makefile.inc
@@ -1 +1,6 @@
-# $OpenBSD: Makefile.inc,v 1.1 2006/10/10 22:07:10 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.2 2006/11/06 15:14:50 drahn Exp $
+
+CPPFLAGS += -DSOFTFLOAT
+
+SOFTFLOAT_BITS=32
+.include <arch/arm/softfloat/Makefile.inc>
diff --git a/lib/libc/arch/sh/gen/Makefile.inc b/lib/libc/arch/sh/gen/Makefile.inc
index cbc14441016..fb4af29eb92 100644
--- a/lib/libc/arch/sh/gen/Makefile.inc
+++ b/lib/libc/arch/sh/gen/Makefile.inc
@@ -1,5 +1,8 @@
-# $OpenBSD: Makefile.inc,v 1.3 2006/10/11 03:20:56 drahn Exp $
+# $OpenBSD: Makefile.inc,v 1.4 2006/11/06 15:14:50 drahn Exp $
-SRCS+= fabs.c flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c \
- fpsetmask.c fpsetround.c fpsetsticky.c isinf.c isnan.c infinity.c \
- setjmp.S _setjmp.S sigsetjmp.S modf.c ldexp.c
+SRCS+= flt_rounds.c isinf.c isnan.c infinity.c setjmp.S _setjmp.S sigsetjmp.S \
+ modf.c ldexp.c
+
+#hardfloat only pieces
+#SRCS+= fabs.c fpgetmask.c fpgetround.c fpgetsticky.c \
+# fpsetmask.c fpsetround.c fpsetsticky.c \
diff --git a/lib/libc/arch/sh/gen/fabs.c b/lib/libc/arch/sh/gen/fabs.c
index d31572b61fe..b31405a29d5 100644
--- a/lib/libc/arch/sh/gen/fabs.c
+++ b/lib/libc/arch/sh/gen/fabs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fabs.c,v 1.1 2006/10/10 22:07:10 miod Exp $ */
+/* $OpenBSD: fabs.c,v 1.2 2006/11/06 15:14:50 drahn Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -21,6 +21,11 @@
double
fabs(double x)
{
+#ifdef __SH4__
__asm__ __volatile__("fabs %0" : "=f"(x));
+#else
+ if (x < 0)
+ x = -x;
+#endif
return (x);
}