1 1.1 matt /* $NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 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.1 matt __RCSID("$NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $"); 14 1.1 matt #endif /* LIBC_SCCS and not lint */ 15 1.1 matt 16 1.1 matt int __aeabi_dcmpun(float64, float64); 17 1.1 matt 18 1.1 matt int 19 1.1 matt __aeabi_dcmpun(float64 a, float64 b) 20 1.1 matt { 21 1.1 matt /* 22 1.1 matt * The comparison is unordered if either input is a NaN. 23 1.1 matt * Test for this by comparing each operand with itself. 24 1.1 matt * We must perform both comparisons to correctly check for 25 1.1 matt * signalling NaNs. 26 1.1 matt */ 27 1.1 matt return !float64_eq(a, a) || !float64_eq(b, b); 28 1.1 matt } 29