Lines Matching +full:per +full:- +full:string
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2013-2021, Arm Limited.
6 * https://github.com/ARM-software/optimized-routines/blob/98e4d6a5c13c8e54/string/aarch64/strlen.S
11 #include <asm/mte-def.h>
15 * ARMv8-a, AArch64, unaligned accesses, min page size 4k.
36 /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
37 (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
39 (X - 1) & 0x80 is zero for non-NUL ASCII characters, but gives
48 * (16-byte) granularity, and we must ensure that no access straddles this
58 of the string for a NUL character. In order to do an unaligned ldp
60 byte we calculate the length from the 2 8-byte words using
64 If the string is longer than 16 bytes, we align src so don't need
65 further page cross checks, and process 32 bytes per iteration
66 using the fast NUL check. If we encounter non-ASCII characters,
70 address, remove any characters before the string, and continue
76 checking for larger page sizes - the cost of setting up the correct
83 and tmp1, srcin, MIN_PAGE_SIZE - 1
85 cmp tmp1, MIN_PAGE_SIZE - 16
89 /* For big-endian, carry propagation (if the final byte in the
90 string is 0x01) means we cannot use has_nul1/2 directly.
91 Since we expect strings to be small and early-exit,
92 byte-swap the data now so has_null1/2 will be correct. */
114 /* The inner loop processes 32 bytes per iteration and uses the fast
115 NUL check. If we encounter non-ASCII characters, use a second
148 /* For big-endian, carry propagation (if the final byte in the
149 string is 0x01) means we cannot use has_nul1/2 directly. The
150 easiest way to get the correct byte is to byte-swap the data
190 srcin to 0x7f, so we ignore any NUL bytes before the string.
196 mov tmp4, -1
198 /* Big-endian. Early bytes are at MSB. */
201 /* Little-endian. Early bytes are at LSB. */