Lines Matching +full:sub +full:- +full:systems
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
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,
75 AArch64 systems have a minimum page size of 4k. We don't bother
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. */
96 sub tmp1, data1, zeroones
98 sub tmp3, data2, zeroones
115 NUL check. If we encounter non-ASCII characters, use a second
120 sub src, src, 16
124 sub tmp1, data1, zeroones
125 sub tmp3, data2, zeroones
130 sub tmp1, data1, zeroones
131 sub tmp3, data2, zeroones
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
154 sub tmp1, data1, zeroones
160 sub len, src, srcin
170 sub tmp1, data1, zeroones
172 sub tmp3, data2, zeroones
179 sub tmp1, data1, zeroones
181 sub tmp3, data2, zeroones
196 mov tmp4, -1
198 /* Big-endian. Early bytes are at MSB. */
201 /* Little-endian. Early bytes are at LSB. */