summaryrefslogtreecommitdiff
path: root/lib/libc/softfloat
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2014-01-30 19:06:54 +0000
committermatt <matt@NetBSD.org>2014-01-30 19:06:54 +0000
commita379a509c829a9eaa0e90993ecd006fa0e1d8359 (patch)
tree68ba6666623bc06c5a6ee755591fabe2f2f0a713 /lib/libc/softfloat
parentb10b79ef233f9d8e471e57c2090d29465639df43 (diff)
unord for float128 long double
Diffstat (limited to 'lib/libc/softfloat')
-rw-r--r--lib/libc/softfloat/unordtf2.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/libc/softfloat/unordtf2.c b/lib/libc/softfloat/unordtf2.c
new file mode 100644
index 00000000000..37120d10ced
--- /dev/null
+++ b/lib/libc/softfloat/unordtf2.c
@@ -0,0 +1,28 @@
+/* $NetBSD: unordtf2.c,v 1.1 2014/01/30 19:06:54 matt 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: unordtf2.c,v 1.1 2014/01/30 19:06:54 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+flag __unordtf2(float128, float128);
+
+flag
+__unordtf2(float128 a, float128 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 ^ (float128_eq(a, a) & float128_eq(b, b));
+}