← Back to archive

Stdle #33 · simd · 2026-07-09

What does this Zig snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const std = @import("std");
pub fn main() void {
const v: @Vector(4, i32) = .{ 1, 2, 3, 4 };
const shifted = v << @as(@Vector(4, u5), @splat(1));
std.debug.print("{d} {d} {d} {d}\n", .{ shifted[0], shifted[1], shifted[2], shifted[3] });
}
SIMD
4 attempts left

Answer & explanation