Does anyone know if it is possible to have zig emit vunpck[hl][pd|ps] etc. instructions?
Everything i try is being compiled to two permutes and a blend
push rbp
mov rbp, rsp
vpermpd ymm0, ymmword ptr [rsi], 96
vpermpd ymm1, ymmword ptr [rdi], 212
vblendps ymm0, ymm1, ymm0, 204
vmovups ymmword ptr [rdx], ymm0
pop rbp
vzeroupper
ret
Maybe i seeing thing wrong but thats 3 uops with a latency of 5 wheres a vunpck instruction would be 1 uop with latency 1.
I tried using @“llvm” intrinsics but in there i cannot find unpck instructions for avx2 (only mmx). Are they not implemented or something?
Also in doc/langref/destructuring_vectors.zig there is:
// 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 };
}
but this gives me the aformentioned assembly output.
