Lines Matching +full:a +full:- +full:8

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.
49 On big-endian early bytes are at MSB and on little-endian LSB.
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
75 ldr data1, [src1], #8
76 ldr data2, [src2], #8
78 subs limit, limit, #8
81 eor diff, data1, data2 /* Non-zero if differences found. */
83 bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
91 add limit, limit, 8 /* Rewind limit to before last subs. */
102 /* But we need to zero-extend (char is unsigned) the value and then
103 perform a signed 32-bit subtraction. */
109 /* Not reached the limit, must have found the end or a diff. */
111 add tmp1, limit, 8
114 lsl limit, tmp1, #3 /* Bits -> bytes. */
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
151 /* But we need to zero-extend (char is unsigned) the value and then
152 perform a signed 32-bit subtraction. */
166 ldr data1, [src1], #8
167 neg tmp3, count, lsl #3 /* 64 - bits(bytes beyond align). */
168 ldr data2, [src2], #8
195 /* Align the SRC1 to a dword by doing a bytewise compare and then do
214 The bytes are shown in natural order. For little-endian, it is
217 src1 | a a a a a a a a | b b b c c c c c | . . .
218 src2 | x x x x x a a a a a a a a b b b | c c c c c . . .
222 data1 a a a a a a a a b b b c c c c c b b b c c c c c
223 data2 a a a a a a a a b b b 0 0 0 0 0 0 0 0 c c c c c
227 Align SRC2 down to 16 bytes. This way we can read 16 bytes at a
231 /* Calculate offset from 8 byte alignment to string start in bits. No
235 mov mask, -1
237 ldr data1, [src1], #8
245 /* STEP_A: Compare full 8 bytes when there is enough data from SRC2.*/
248 subs limit, limit, #8
249 orr data2, data2, tmp1 /* 8 bytes from SRC2 combined from two regs.*/
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. */
258 ldr data1, [src1], #8
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. */
286 cmp limit, #8
288 eor diff, data2, data1 /* Non-zero if differences found. */
294 ldr data1, [src1], #8
295 sub limit, limit, #8