2 * ====================================================
3 * Copyright (C) 1998, 2002, 2008 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(strlen)
27 #if defined __OPTIMIZE_SIZE__ || defined __iamcu__
35 /* Modern x86 hardware is much faster at double-word
36 manipulation than with bytewise repnz scasb. */
38 /* Do byte-wise checks until string is aligned. */
64 /* loop performing 4 byte mask checking for desired 0 byte */
69 leal -16843009(ecx),eax
72 testl $-2139062144,eax
75 /* Find which of four bytes is 0. */