unorddf2.c revision 129203
1129203Scognet/* $NetBSD: unorddf2.c,v 1.1 2003/05/06 08:58:19 rearnsha Exp $ */ 2129203Scognet 3129203Scognet/* 4129203Scognet * Written by Richard Earnshaw, 2003. This file is in the Public Domain. 5129203Scognet */ 6129203Scognet 7129203Scognet#include "softfloat-for-gcc.h" 8129203Scognet#include "milieu.h" 9129203Scognet#include "softfloat.h" 10129203Scognet 11129203Scognet#include <sys/cdefs.h> 12129203Scognet__FBSDID("$FreeBSD: head/lib/libc/softfloat/unorddf2.c 129203 2004-05-14 12:13:06Z cognet $"); 13129203Scognet 14129203Scognetflag __unorddf2(float64, float64); 15129203Scognet 16129203Scognetflag 17129203Scognet__unorddf2(float64 a, float64 b) 18129203Scognet{ 19129203Scognet /* 20129203Scognet * The comparison is unordered if either input is a NaN. 21129203Scognet * Test for this by comparing each operand with itself. 22129203Scognet * We must perform both comparisons to correctly check for 23129203Scognet * signalling NaNs. 24129203Scognet */ 25129203Scognet return 1 ^ (float64_eq(a, a) & float64_eq(b, b)); 26129203Scognet} 27