tiny.simd.mismatch
Defined in algo.
Returns the index of the first lane where two equal-length spans differ, or their length when every lane agrees.
Source
Source: lib/simd/src/algo.zig:172
zig
/// Returns the index of the first lane where two equal-length spans differ,/// or their length when every lane agrees. Whole vectors compare first, and/// the last vector overlaps lanes already known equal. A byte span shorter/// than a vector compares eight bytes at a time the same way.pub fn mismatch(comptime D: type, left: []const D.Lane, right: []const D.Lane) usize { requireInteger(D.Lane, "mismatch"); std.debug.assert(left.len == right.len); if (left.len >= D.lane_count) return vectorMismatch(D, left, right); if (D.Lane == u8 and left.len >= word_bytes) return wordMismatch(left, right); for (left, right, 0..) |first, second, index| { if (first != second) return index; } return left.len;}Source: lib/simd/src/root.zig:463
zig
pub const mismatch = algo.mismatch;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |