Lines Matching +full:non +full:- +full:zero
1 /* SPDX-License-Identifier: GPL-2.0-only */
9 * http://bazaar.launchpad.net/~linaro-toolchain-dev/cortex-strings/trunk/
20 * x0 - const string 1 pointer
21 * x1 - const string 2 pointer
22 * x2 - the maximal length to be compared
24 * x0 - an integer less than, equal to, or greater than zero if s1 is found,
63 /* Calculate the number of full and partial words -1. */
72 * NUL detection works on the principle that (X - 1) & (~X) & 0x80
73 * (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
83 eor diff, data1, data2 /* Non-zero if differences found. */
85 bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
96 lsl limit, limit, #3 /* Bits -> bytes. */
121 neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */
125 /* Big-endian. Early bytes are at MSB. */
127 /* Little-endian. Early bytes are at LSB. */
191 eor diff, data1, data2 /* Non-zero if differences found. */
194 ccmp endloop, #0, #0, eq /*has_null is ZERO: no null byte*/
214 bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
215 eor diff, data1, data2 /* Non-zero if differences found. */
225 eor diff, data1, data2 /* Non-zero if differences found. */
228 ccmp endloop, #0, #0, eq /*has_null is ZERO: no null byte*/
236 * reversed the byte-order as big-endian,then CLZ can find the most
237 * significant zero bits.
243 * For big-endian we cannot use the trick with the syndrome value
244 * as carry-propagation can corrupt the upper bits if the trailing
256 /* Re-compute the NUL-byte detection, using a byte-reversed value.*/
264 * The MS-non-zero bit of the syndrome marks either the first bit
265 * that is different, or the top bit of the first zero byte.
273 * But we need to zero-extend (char is unsigned) the value and then
274 * perform a signed 32-bit subtraction.