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