Lines Matching +full:non +full:- +full:l

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2013-2022, Arm Limited.
6 * https://github.com/ARM-software/optimized-routines/blob/189dfefe37d54c5b/string/aarch64/strncmp.S
14 * ARMv8-a, AArch64.
18 #define L(label) .L ## label macro
49 On big-endian early bytes are at MSB and on little-endian LSB.
62 cbz limit, L(ret0)
67 b.ne L(misaligned8)
68 cbnz count, L(mutual_align)
70 /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
71 (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
74 L(loop_aligned):
77 L(start_realigned):
81 eor diff, data1, data2 /* Non-zero if differences found. */
83 bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
85 b.eq L(loop_aligned)
88 L(full_check):
92 L(syndrome_check):
102 /* But we need to zero-extend (char is unsigned) the value and then
103 perform a signed 32-bit subtraction. */
110 tbz limit, #63, L(not_limit)
112 cbz limit, L(not_limit)
114 lsl limit, tmp1, #3 /* Bits -> bytes. */
123 L(not_limit):
124 /* For big-endian we cannot use the trick with the syndrome value
125 as carry-propagation can corrupt the upper bits if the trailing
136 /* Re-compute the NUL-byte detection, using a byte-reversed value. */
144 /* The most-significant-non-zero bit of the syndrome marks either the
148 L(end_quick):
151 /* But we need to zero-extend (char is unsigned) the value and then
152 perform a signed 32-bit subtraction. */
158 L(mutual_align):
167 neg tmp3, count, lsl #3 /* 64 - bits(bytes beyond align). */
176 b L(start_realigned)
180 L(misaligned8):
182 b.hs L(try_misaligned_words)
184 L(byte_loop):
191 b.eq L(byte_loop)
192 L(done):
197 L(try_misaligned_words):
198 cbz count, L(src1_aligned)
204 L(page_end_loop):
209 b.ne L(done)
211 b.hi L(page_end_loop)
214 The bytes are shown in natural order. For little-endian, it is
230 L(src1_aligned):
235 mov mask, -1
242 tbnz offset, 6, L(misaligned_mid_loop)
244 L(loop_misaligned):
251 eor diff, data1, data2 /* Non-zero if differences found. */
254 bic has_nul, has_nul, tmp3 /* Non-zero if NUL byte found in SRC1. */
256 cbnz tmp3, L(full_check)
259 L(misaligned_mid_loop):
263 /* For big-endian we do a byte reverse to avoid carry-propagation
273 eor diff, data2, data1 /* Non-zero if differences found. */
274 bic has_nul, has_nul, tmp3 /* Non-zero if NUL terminator. */
282 cbnz tmp3, L(syndrome_check)
288 eor diff, data2, data1 /* Non-zero if differences found. */
292 cbnz tmp3, L(syndrome_check)
296 b L(loop_misaligned)
299 L(syndrome_check):
302 b.lo L(end_quick)
305 L(ret0):