Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/softfloat GCC-3 requires a libcall to support testi...



details:   https://anonhg.NetBSD.org/src/rev/717d110ce987
branches:  trunk
changeset: 546770:717d110ce987
user:      rearnsha <rearnsha%NetBSD.org@localhost>
date:      Tue May 06 08:58:19 2003 +0000

description:
GCC-3 requires a libcall to support testing for unordered.

diffstat:

 lib/libc/softfloat/Makefile.inc |   5 +++--
 lib/libc/softfloat/unorddf2.c   |  28 ++++++++++++++++++++++++++++
 lib/libc/softfloat/unordsf2.c   |  28 ++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 2 deletions(-)

diffs (80 lines):

diff -r 0367e294dca6 -r 717d110ce987 lib/libc/softfloat/Makefile.inc
--- a/lib/libc/softfloat/Makefile.inc   Tue May 06 08:49:05 2003 +0000
+++ b/lib/libc/softfloat/Makefile.inc   Tue May 06 08:58:19 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.2 2002/05/21 23:51:05 bjh21 Exp $
+#      $NetBSD: Makefile.inc,v 1.3 2003/05/06 08:58:20 rearnsha Exp $
 
 SOFTFLOAT_BITS?=64
 .PATH:         ${ARCHDIR}/softfloat \
@@ -13,4 +13,5 @@
                fpgetsticky.c fpsetsticky.c
 
 SRCS+=         eqsf2.c nesf2.c gtsf2.c gesf2.c ltsf2.c lesf2.c negsf2.c \
-               eqdf2.c nedf2.c gtdf2.c gedf2.c ltdf2.c ledf2.c negdf2.c
+               eqdf2.c nedf2.c gtdf2.c gedf2.c ltdf2.c ledf2.c negdf2.c \
+               unordsf2.c unorddf2.c
diff -r 0367e294dca6 -r 717d110ce987 lib/libc/softfloat/unorddf2.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/unorddf2.c     Tue May 06 08:58:19 2003 +0000
@@ -0,0 +1,28 @@
+/* $NetBSD: unorddf2.c,v 1.1 2003/05/06 08:58:19 rearnsha Exp $ */
+
+/*
+ * Written by Richard Earnshaw, 2003.  This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: unorddf2.c,v 1.1 2003/05/06 08:58:19 rearnsha Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+flag __unorddf2(float64, float64);
+
+flag
+__unorddf2(float64 a, float64 b)
+{
+       /*
+        * The comparison is unordered if either input is a NaN.
+        * Test for this by comparing each operand with itself.
+        * We must perform both comparisons to correctly check for
+        * signalling NaNs.
+        */
+       return 1 ^ (float64_eq(a, a) & float64_eq(b, b));
+}
diff -r 0367e294dca6 -r 717d110ce987 lib/libc/softfloat/unordsf2.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/unordsf2.c     Tue May 06 08:58:19 2003 +0000
@@ -0,0 +1,28 @@
+/* $NetBSD: unordsf2.c,v 1.1 2003/05/06 08:58:20 rearnsha Exp $ */
+
+/*
+ * Written by Richard Earnshaw, 2003.  This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: unordsf2.c,v 1.1 2003/05/06 08:58:20 rearnsha Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+flag __unordsf2(float32, float32);
+
+flag
+__unordsf2(float32 a, float32 b)
+{
+       /*
+        * The comparison is unordered if either input is a NaN.
+        * Test for this by comparing each operand with itself.
+        * We must perform both comparisons to correctly check for
+        * signalling NaNs.
+        */
+       return 1 ^ (float32_eq(a, a) & float32_eq(b, b));
+}



Home | Main Index | Thread Index | Old Index