mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
17 lines
416 B
Zig
17 lines
416 B
Zig
const print = @import("std").debug.print;
|
|
|
|
// emulate punpckldq
|
|
pub fn unpack(x: @Vector(4, f32), y: @Vector(4, f32)) @Vector(4, f32) {
|
|
const a, const c, _, _ = x;
|
|
const b, const d, _, _ = y;
|
|
return .{ a, b, c, d };
|
|
}
|
|
|
|
pub fn main() void {
|
|
const x: @Vector(4, f32) = .{ 1.0, 2.0, 3.0, 4.0 };
|
|
const y: @Vector(4, f32) = .{ 5.0, 6.0, 7.0, 8.0 };
|
|
print("{}", .{unpack(x, y)});
|
|
}
|
|
|
|
// exe=succeed
|