2 * ====================================================
3 * Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
5 * Permission to use, copy, modify, and distribute this
6 * software is freely granted, provided that this notice
8 * ====================================================
14 SOTYPE_FUNCTION(memcmp)
29 /* check if length is zero in which case just return 0 */
35 #ifndef __OPTIMIZE_SIZE__
37 /* if aligned on long boundary, compare doublewords at a time first */
44 shrl $2,ecx /* calculate number of long words to compare */
53 andl $3,ebx /* calculate number of remaining bytes */
56 #endif /* not __OPTIMIZE_SIZE__ */
58 BYTECMP: /* compare any unaligned bytes or remainder bytes */
62 /* set output to be < 0 if less than, 0 if equal, or > 0 if greater than */