Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/powerpc/gen split fabs.c into hardfloat .S and...



details:   https://anonhg.NetBSD.org/src/rev/a0987a1e2783
branches:  trunk
changeset: 326402:a0987a1e2783
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Jan 28 13:47:04 2014 +0000

description:
split fabs.c into hardfloat .S and softfloat .c as requested by joerg

diffstat:

 lib/libc/arch/powerpc/gen/Makefile.inc   |   7 +++++--
 lib/libc/arch/powerpc/gen/fabs.c         |  15 ---------------
 lib/libc/arch/powerpc/gen/fabs_ieee754.S |  12 ++++++++++++
 lib/libc/arch/powerpc/gen/fabs_ieee754.c |  11 +++++++++++
 4 files changed, 28 insertions(+), 17 deletions(-)

diffs (74 lines):

diff -r 4dd59301eecb -r a0987a1e2783 lib/libc/arch/powerpc/gen/Makefile.inc
--- a/lib/libc/arch/powerpc/gen/Makefile.inc    Tue Jan 28 13:43:33 2014 +0000
+++ b/lib/libc/arch/powerpc/gen/Makefile.inc    Tue Jan 28 13:47:04 2014 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: Makefile.inc,v 1.25 2011/03/12 07:55:09 matt Exp $
+#      $NetBSD: Makefile.inc,v 1.26 2014/01/28 13:47:04 macallan Exp $
 
 SRCS+= __setjmp14.S __sigsetjmp14.S _setjmp.S
 SRCS+= bswap16.c bswap32.c bswap64.c
-SRCS+= fabs.c flt_rounds.c
+SRCS+= flt_rounds.c
 SRCS+= syncicache.c
 SRCS+=  _lwp.c makecontext.c resumecontext.c swapcontext.S
 
@@ -19,6 +19,9 @@
 .if (${MKSOFTFLOAT} == "no")
 SRCS+= fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c
 SRCS+= fpgetsticky.c fpsetsticky.c
+SRCS+= fabs_ieee754.S
+.else
+SRCS+= fabs_ieee754.c
 .endif
 
 CPPFLAGS._lwp.c        += -D_LIBC_SOURCE
diff -r 4dd59301eecb -r a0987a1e2783 lib/libc/arch/powerpc/gen/fabs.c
--- a/lib/libc/arch/powerpc/gen/fabs.c  Tue Jan 28 13:43:33 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-/*     $NetBSD: fabs.c,v 1.4 2005/12/24 23:10:08 perry Exp $   */
-
-#include <math.h>
-
-double
-fabs(double x)
-{
-#ifdef _SOFT_FLOAT
-       if (x < 0)
-               x = -x;
-#else
-       __asm volatile("fabs %0,%1" : "=f"(x) : "f"(x));
-#endif
-       return (x);
-}
diff -r 4dd59301eecb -r a0987a1e2783 lib/libc/arch/powerpc/gen/fabs_ieee754.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/powerpc/gen/fabs_ieee754.S  Tue Jan 28 13:47:04 2014 +0000
@@ -0,0 +1,12 @@
+/*     $NetBSD: fabs_ieee754.S,v 1.1 2014/01/28 13:47:04 macallan Exp $        */
+
+#include <machine/asm.h>
+
+#if defined(LIBC_SCCS)
+__RCSID("$NetBSD: fabs_ieee754.S,v 1.1 2014/01/28 13:47:04 macallan Exp $")
+#endif
+
+ENTRY(fabs)
+       fabs %f1,%f1
+       blr
+END(fabs)
diff -r 4dd59301eecb -r a0987a1e2783 lib/libc/arch/powerpc/gen/fabs_ieee754.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/powerpc/gen/fabs_ieee754.c  Tue Jan 28 13:47:04 2014 +0000
@@ -0,0 +1,11 @@
+/*     $NetBSD: fabs_ieee754.c,v 1.1 2014/01/28 13:47:04 macallan Exp $        */
+
+#include <math.h>
+
+double
+fabs(double x)
+{
+       if (x < 0)
+               x = -x;
+       return (x);
+}



Home | Main Index | Thread Index | Old Index