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