tiny.simd.order
Defined in algo.
Orders two spans of integer lanes lexicographically, as std.mem.order orders slices.
Source
Source: lib/simd/src/algo.zig:189
zig
/// Orders two spans of integer lanes lexicographically, as `std.mem.order`/// orders slices. The first differing lane decides, and a span that is a/// prefix of the other orders first. Byte spans that share less than a/// vector compare as big-endian words, which order as their bytes do. Longer/// spans compare vectors out of line, so ordering a short key reserves no/// registers for the vector loop.pub fn order(comptime D: type, left: []const D.Lane, right: []const D.Lane) std.math.Order { requireInteger(D.Lane, "order"); const shared = @min(left.len, right.len); if (shared >= D.lane_count) return vectorOrder(D, left, right); if (D.Lane == u8 and shared >= word_bytes) return wordOrder(left, right); for (left[0..shared], right[0..shared]) |first, second| { if (first != second) return std.math.order(first, second); } return std.math.order(left.len, right.len);}Source: lib/simd/src/root.zig:464
zig
pub const order = algo.order;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |