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