diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2006-11-06 15:14:51 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2006-11-06 15:14:51 +0000 |
commit | 141049ba183647762c5f9d3c7fcec9471164d42d (patch) | |
tree | 56dd2354d8f0880c837ad062dae80b4dbc70ce4b /lib/libc/arch | |
parent | 8c80337001e667db6b9fc6355d168e8eb9f7ad8a (diff) |
Move (back) to softfloat on sh for now.
Diffstat (limited to 'lib/libc/arch')
-rw-r--r-- | lib/libc/arch/sh/Makefile.inc | 7 | ||||
-rw-r--r-- | lib/libc/arch/sh/gen/Makefile.inc | 11 | ||||
-rw-r--r-- | lib/libc/arch/sh/gen/fabs.c | 7 |
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); } |