authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2026-05-29 13:09:47+02:00
committergravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2026-09-20 16:05:33+02:00
logfb52b2dcdf9cef0ad1eb1e442072472113d1f6cc
treecd6e8c5f5ed9d14fe6fb619707ce1a0d2a1bfaf3
parentcaa9b1c54dc60007bbf46b425a2947542c8a61ad

Remove unnecessary inline, comment on the necessary one


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

lib/std/crypto/argon2.zig+5-2
...@@ -364,17 +364,20 @@ fn processBlockGeneric(...@@ -364,17 +364,20 @@ fn processBlockGeneric(
364364
365const BlamkaVector = @Vector(4, u64);365const BlamkaVector = @Vector(4, u64);
366366
367inline fn fBlaMka(x: BlamkaVector, y: BlamkaVector) BlamkaVector {367fn fBlaMka(x: BlamkaVector, y: BlamkaVector) BlamkaVector {
368 const x_lo: @Vector(4, u32) = @truncate(x);368 const x_lo: @Vector(4, u32) = @truncate(x);
369 const y_lo: @Vector(4, u32) = @truncate(y);369 const y_lo: @Vector(4, u32) = @truncate(y);
370 const xy = @as(BlamkaVector, x_lo) * @as(BlamkaVector, y_lo);370 const xy = @as(BlamkaVector, x_lo) * @as(BlamkaVector, y_lo);
371 return x +% y +% @as(BlamkaVector, @splat(2)) *% xy;371 return x +% y +% @as(BlamkaVector, @splat(2)) *% xy;
372}372}
373373
374inline fn rotrVector(x: BlamkaVector, comptime n: comptime_int) BlamkaVector {374fn rotrVector(x: BlamkaVector, comptime n: comptime_int) BlamkaVector {
375 return (x >> @splat(n)) | (x << @splat(64 - n));375 return (x >> @splat(n)) | (x << @splat(64 - n));
376}376}
377377
378// The `inline` is load-bearing: without it ReleaseSmall keeps this out of line
379// and shuffles the four vectors through memory across every call, costing
380// roughly 9% on Apple Silicon.
378inline fn blamkaRound(a: *BlamkaVector, b: *BlamkaVector, c: *BlamkaVector, d: *BlamkaVector) void {381inline fn blamkaRound(a: *BlamkaVector, b: *BlamkaVector, c: *BlamkaVector, d: *BlamkaVector) void {
379 a.* = fBlaMka(a.*, b.*);382 a.* = fBlaMka(a.*, b.*);
380 d.* = rotrVector(d.* ^ a.*, 32);383 d.* = rotrVector(d.* ^ a.*, 32);