xref: /minix/lib/libc/softfloat/unordtf2.c (revision 0a6a1f1d)
1 /* $NetBSD: unordtf2.c,v 1.2 2014/01/30 19:11:41 matt Exp $ */
2 
3 /*
4  * Written by Richard Earnshaw, 2003.  This file is in the Public Domain.
5  */
6 
7 #include "softfloat-for-gcc.h"
8 #include "milieu.h"
9 #include "softfloat.h"
10 
11 #include <sys/cdefs.h>
12 #if defined(LIBC_SCCS) && !defined(lint)
13 __RCSID("$NetBSD: unordtf2.c,v 1.2 2014/01/30 19:11:41 matt Exp $");
14 #endif /* LIBC_SCCS and not lint */
15 
16 #ifdef FLOAT128
17 
18 flag __unordtf2(float128, float128);
19 
20 flag
__unordtf2(float128 a,float128 b)21 __unordtf2(float128 a, float128 b)
22 {
23 	/*
24 	 * The comparison is unordered if either input is a NaN.
25 	 * Test for this by comparing each operand with itself.
26 	 * We must perform both comparisons to correctly check for
27 	 * signalling NaNs.
28 	 */
29 	return 1 ^ (float128_eq(a, a) & float128_eq(b, b));
30 }
31 
32 #endif /* FLOAT128 */
33