26{
27 const unsigned char *
const s_end = s +
len;
30#ifdef USE_NO_SIMD
32#endif
33
35
36 while (s < s_end)
37 {
39
40 /* Capture any zero bytes in this chunk. */
41#ifdef USE_NO_SIMD
42
43 /*
44 * First, add 0x7f to each byte. This sets the high bit in each byte,
45 * unless it was a zero. If any resulting high bits are zero, the
46 * corresponding high bits in the zero accumulator will be cleared.
47 *
48 * If none of the bytes in the chunk had the high bit set, the max
49 * value each byte can have after the addition is 0x7f + 0x7f = 0xfe,
50 * and we don't need to worry about carrying over to the next byte. If
51 * any input bytes did have the high bit set, it doesn't matter
52 * because we check for those separately.
53 */
55#else
56
57 /*
58 * Set all bits in each lane of the highbit accumulator where input
59 * bytes are zero.
60 */
63#endif
64
65 /* Capture all set bits in this chunk. */
67
68 s += sizeof(chunk);
69 }
70
71 /* Check if any high bits in the high bit accumulator got set. */
73 return false;
74
75#ifdef USE_NO_SIMD
76 /* Check if any high bits in the zero accumulator got cleared. */
78 return false;
79#endif
80
81 return true;
82}
Assert(PointerIsAligned(start, uint64))
static Vector8 vector8_broadcast(const uint8 c)
static void vector8_load(Vector8 *v, const uint8 *s)
static Vector8 vector8_or(const Vector8 v1, const Vector8 v2)
static bool vector8_is_highbit_set(const Vector8 v)