Lines Matching +full:byte +full:- +full:len
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.
22 #define len x0 macro
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
60 byte we calculate the length from the 2 8-byte words using
66 using the fast NUL check. If we encounter non-ASCII characters,
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
91 Since we expect strings to be small and early-exit,
92 byte-swap the data now so has_null1/2 will be correct. */
107 mov len, 8
110 csel len, xzr, len, cc
111 add len, len, tmp1, lsr 3
115 NUL check. If we encounter non-ASCII characters, use a second
148 /* For big-endian, carry propagation (if the final byte in the
150 easiest way to get the correct byte is to byte-swap the data
160 sub len, src, srcin
162 add tmp2, len, 8
164 csel len, len, tmp2, cc
165 add len, len, tmp1, lsr 3
196 mov tmp4, -1
198 /* Big-endian. Early bytes are at MSB. */
201 /* Little-endian. Early bytes are at LSB. */