From 141049ba183647762c5f9d3c7fcec9471164d42d Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Mon, 6 Nov 2006 15:14:51 +0000 Subject: Move (back) to softfloat on sh for now. --- lib/libc/arch/sh/Makefile.inc | 7 ++++++- lib/libc/arch/sh/gen/Makefile.inc | 11 +++++++---- lib/libc/arch/sh/gen/fabs.c | 7 ++++++- 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'lib/libc/arch') 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 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); } -- cgit v1.2.3