	.file	"isnand.s"
/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 *
 */


	.ident	"@(#)libc-i386:libc-i386/gen/isnand.s	1.2.1.1"


/*	int isnand(srcD)
 *	double srcD;
 *
 *	This routine returns 1 if the argument is a NaN
 *		     returns 0 otherwise.
 */

#include "sys.s"
	.set	DMAX_EXP,0x7ff

ENTRY(isnand)
	movl	8(%esp),%eax
	andl	$0x7ff00000,%eax	/ bits 62-52
	cmpl	$[DMAX_EXP<<20],%eax
	jne	.false

	movl	8(%esp),%eax
	andl	$0x000fffff,%eax	/ bits 51-32
	orl	4(%esp),%eax		/ bits 31-0
	jz	.false			/ all fraction bits are 0
					/ its an infinity
	movl	$1,%eax
	ret
.false:
	movl	$0,%eax
	ret
