xref: /csrg-svn/lib/libc/quad/ucmpdi2.c (revision 61160)
153445Sbostic /*-
2*61160Sbostic  * Copyright (c) 1992, 1993
3*61160Sbostic  *	The Regents of the University of California.  All rights reserved.
453445Sbostic  *
553794Sbostic  * This software was developed by the Computer Systems Engineering group
653794Sbostic  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
753794Sbostic  * contributed to Berkeley.
853794Sbostic  *
953445Sbostic  * %sccs.include.redist.c%
1053445Sbostic  */
1153445Sbostic 
1253445Sbostic #if defined(LIBC_SCCS) && !defined(lint)
13*61160Sbostic static char sccsid[] = "@(#)ucmpdi2.c	8.1 (Berkeley) 06/04/93";
1453445Sbostic #endif /* LIBC_SCCS and not lint */
1553445Sbostic 
1653794Sbostic #include "quad.h"
1753459Sbostic 
1853794Sbostic /*
1953794Sbostic  * Return 0, 1, or 2 as a <, =, > b respectively.
2053794Sbostic  * Neither a nor b are considered signed.
2153794Sbostic  */
2253794Sbostic int
__ucmpdi2(a,b)2354431Sbostic __ucmpdi2(a, b)
2454431Sbostic 	u_quad_t a, b;
2553445Sbostic {
2653794Sbostic 	union uu aa, bb;
2753445Sbostic 
2853794Sbostic 	aa.uq = a;
2953794Sbostic 	bb.uq = b;
3053794Sbostic 	return (aa.ul[H] < bb.ul[H] ? 0 : aa.ul[H] > bb.ul[H] ? 2 :
3153794Sbostic 	    aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1);
3253445Sbostic }
33