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