authorgravatar for lauri@hacktheplanet.fiLauri Tirkkonen <lauri@hacktheplanet.fi> 2023-06-28 19:42:43+09:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-28 17:33:02-07:00
log82520a214ca7149a1acf658c3e4ddf257c450e79
tree429ec7207c73e84a87a583be0a26c59d0e750d2b
parent0c1bfe271ec937b0b4fa1b7b17773dd09c27131c

std.crypto.hash.sha2: require avx2 on x86_64

according to https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=vpalignr&ig_expand=283,283,284,283,283&techs=AVX_ALL the vpalignr instruction requires AVX2 support

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/crypto/sha2.zig+1-1
......@@ -238,7 +238,7 @@ fn Sha2x32(comptime params: Sha2Params32) type {
238238 return;
239239 },
240240 // C backend doesn't currently support passing vectors to inline asm.
241 .x86_64 => if (builtin.zig_backend != .stage2_c and comptime std.Target.x86.featureSetHas(builtin.cpu.features, .sha)) {
241 .x86_64 => if (builtin.zig_backend != .stage2_c and comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .sha, .avx2 })) {
242242 var x: v4u32 = [_]u32{ d.s[5], d.s[4], d.s[1], d.s[0] };
243243 var y: v4u32 = [_]u32{ d.s[7], d.s[6], d.s[3], d.s[2] };
244244 const s_v = @as(*[16]v4u32, @ptrCast(&s));