xref: /csrg-svn/lib/libc/quad/ucmpdi2.c (revision 53445)
1*53445Sbostic /*-
2*53445Sbostic  * Copyright (c) 1992 The Regents of the University of California.
3*53445Sbostic  * All rights reserved.
4*53445Sbostic  *
5*53445Sbostic  * %sccs.include.redist.c%
6*53445Sbostic  */
7*53445Sbostic 
8*53445Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*53445Sbostic static char sccsid[] = "@(#)ucmpdi2.c	5.1 (Berkeley) 05/12/92";
10*53445Sbostic #endif /* LIBC_SCCS and not lint */
11*53445Sbostic 
12*53445Sbostic #include "longlong.h"
13*53445Sbostic 
14*53445Sbostic SItype
15*53445Sbostic __ucmpdi2 (a, b)
16*53445Sbostic      long long a, b;
17*53445Sbostic {
18*53445Sbostic   long_long au, bu;
19*53445Sbostic 
20*53445Sbostic   au.ll = a, bu.ll = b;
21*53445Sbostic 
22*53445Sbostic   if ((unsigned) au.s.high < (unsigned) bu.s.high)
23*53445Sbostic     return 0;
24*53445Sbostic   else if ((unsigned) au.s.high > (unsigned) bu.s.high)
25*53445Sbostic     return 2;
26*53445Sbostic   if ((unsigned) au.s.low < (unsigned) bu.s.low)
27*53445Sbostic     return 0;
28*53445Sbostic   else if ((unsigned) au.s.low > (unsigned) bu.s.low)
29*53445Sbostic     return 2;
30*53445Sbostic   return 1;
31*53445Sbostic }
32