This beats @memset in 0.16.0.
Another vectorization regression thingy?
fn crazy_memset(dst: []u8, value: u8) void {
const UNROLL = std.simd.suggestVectorLength(u8) orelse @sizeOf(usize);
var i: usize = 0;
while (i + UNROLL <= dst.len) : (i += UNROLL) {
const p: *align(1) @Vector(UNROLL, u8) = @ptrCast(dst[i..]);
p.* = @splat(value);
}
while (i < dst.len) : (i += 1) {
dst[i] = value;
}
}