Why does the SIMD path use < instead of <= in std.mem.findScalarPos?
Ziggit
Why does the SIMD path use < instead of <= in std.mem.findScalarPos?
I’m trying to understand the reasoning behind the < checks in this SIMD code. The relevant part is: if (i + 2 * block_len < slice.len) { const mask: Block = @splat(value); while (true) { inline for (0..2) |_| { const block: Block = slice[i..][0..block_len].*; const matches = block == mask; if (@reduce(.Or, matches)) { return i + std.simd.firstTrue(matches).?; } i += block_len; } if (i + ...
0 comments
No comments yet.