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(strchr)
26 #ifndef __OPTIMIZE_SIZE__
27 /* check if string is aligned, if not do check one byte at a time */
31 /* create 4 byte mask which is just the desired byte repeated 4 times */
40 /* loop performing 4 byte mask checking for 0 byte or desired byte */
45 leal -16843009(ecx),edx
49 testl $-2139062144,edx
54 leal -16843009(eax),edx
57 testl $-2139062144,edx
59 #endif /* not __OPTIMIZE_SIZE__ */
61 /* loop while (*s && *s++ != c) */
74 /* if (*s == c) return address otherwise return NULL */