Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/softfloat Add long double functions for eq, ne, gt, le...
details: https://anonhg.NetBSD.org/src/rev/a6465baa884d
branches: trunk
changeset: 760926:a6465baa884d
user: matt <matt%NetBSD.org@localhost>
date: Mon Jan 17 10:08:35 2011 +0000
description:
Add long double functions for eq,ne,gt,le,ge,lt,neg ops.
diffstat:
lib/libc/softfloat/Makefile.inc | 3 ++-
lib/libc/softfloat/eqtf2.c | 26 ++++++++++++++++++++++++++
lib/libc/softfloat/getf2.c | 28 ++++++++++++++++++++++++++++
lib/libc/softfloat/gttf2.c | 28 ++++++++++++++++++++++++++++
lib/libc/softfloat/letf2.c | 28 ++++++++++++++++++++++++++++
lib/libc/softfloat/lttf2.c | 28 ++++++++++++++++++++++++++++
lib/libc/softfloat/negtf2.c | 29 +++++++++++++++++++++++++++++
lib/libc/softfloat/netf2.c | 28 ++++++++++++++++++++++++++++
8 files changed, 197 insertions(+), 1 deletions(-)
diffs (240 lines):
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/Makefile.inc
--- a/lib/libc/softfloat/Makefile.inc Mon Jan 17 09:43:56 2011 +0000
+++ b/lib/libc/softfloat/Makefile.inc Mon Jan 17 10:08:35 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.6 2009/12/06 11:16:26 uebayasi Exp $
+# $NetBSD: Makefile.inc,v 1.7 2011/01/17 10:08:35 matt Exp $
SOFTFLOAT_BITS?=64
.PATH: ${ARCHDIR}/softfloat \
@@ -14,6 +14,7 @@
SRCS.softfloat+=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 \
+ eqtf2.c netf2.c gttf2.c getf2.c lttf2.c letf2.c negtf2.c \
nexf2.c gtxf2.c gexf2.c negxf2.c unordsf2.c unorddf2.c
SRCS+= ${SRCS.softfloat}
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/eqtf2.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/eqtf2.c Mon Jan 17 10:08:35 2011 +0000
@@ -0,0 +1,26 @@
+/* $NetBSD: eqtf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */
+
+/*
+ * Written by Matt Thomas, 2011. This file is in the Public Domain.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: eqtf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#ifdef FLOAT128
+flag __eqtf2(float128, float128);
+
+flag
+__eqtf2(float128 a, float128 b)
+{
+
+ /* libgcc1.c says !(a == b) */
+ return !float128_eq(a, b);
+}
+#endif /* FLOAT128 */
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/getf2.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/getf2.c Mon Jan 17 10:08:35 2011 +0000
@@ -0,0 +1,28 @@
+/* $NetBSD: getf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */
+
+/*
+ * Written by Matt Thomas, 2011. 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: getf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef FLOAT128
+
+flag __getf2(float128, float128);
+
+flag
+__getf2(float128 a, float128 b)
+{
+
+ /* libgcc1.c says (a >= b) - 1 */
+ return float128_le(b, a) - 1;
+}
+
+#endif /* FLOAT128 */
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/gttf2.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/gttf2.c Mon Jan 17 10:08:35 2011 +0000
@@ -0,0 +1,28 @@
+/* $NetBSD: gttf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */
+
+/*
+ * Written by Matt Thomas, 2011. 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: gttf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef FLOAT128
+
+flag __gttf2(float128, float128);
+
+flag
+__gttf2(float128 a, float128 b)
+{
+
+ /* libgcc1.c says a > b */
+ return float128_lt(b, a);
+}
+
+#endif /* FLOAT128 */
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/letf2.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/letf2.c Mon Jan 17 10:08:35 2011 +0000
@@ -0,0 +1,28 @@
+/* $NetBSD: letf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */
+
+/*
+ * Written by Matt Thomas, 2011. 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: letf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef FLOAT128
+
+flag __letf2(float128, float128);
+
+flag
+__letf2(float128 a, float128 b)
+{
+
+ /* libgcc1.c says 1 - (a <= b) */
+ return 1 - float128_le(a, b);
+}
+
+#endif /* FLOAT128 */
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/lttf2.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/lttf2.c Mon Jan 17 10:08:35 2011 +0000
@@ -0,0 +1,28 @@
+/* $NetBSD: lttf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */
+
+/*
+ * Written by Matt Thomas, 2011. 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: lttf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef FLOAT128
+
+flag __lttf2(float128, float128);
+
+flag
+__lttf2(float128 a, float128 b)
+{
+
+ /* libgcc1.c says -(a < b) */
+ return -float128_lt(a, b);
+}
+
+#endif /* FLOAT128 */
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/negtf2.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/negtf2.c Mon Jan 17 10:08:35 2011 +0000
@@ -0,0 +1,29 @@
+/* $NetBSD: negtf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */
+
+/*
+ * Written by Matt Thomas, 2011. 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: negtf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef FLOAT128
+
+float128 __negtf2(float128);
+
+float128
+__negtf2(float128 a)
+{
+
+ /* libgcc1.c says -a */
+ a.high ^= FLOAT64_MANGLE(0x8000000000000000ULL);
+ return a;
+}
+
+#endif /* FLOAT128 */
diff -r 76818b1398c3 -r a6465baa884d lib/libc/softfloat/netf2.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/softfloat/netf2.c Mon Jan 17 10:08:35 2011 +0000
@@ -0,0 +1,28 @@
+/* $NetBSD: netf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */
+
+/*
+ * Written by Matt Thomas, 2011. 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: netf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef FLOAT128
+
+flag __netf2(float128, float128);
+
+flag
+__netf2(float128 a, float128 b)
+{
+
+ /* libgcc1.c says a != b */
+ return !float128_eq(a, b);
+}
+
+#endif /* FLOAT128 */
Home |
Main Index |
Thread Index |
Old Index