Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH 0/8] lib/crypto: De-bloat and optimize sha512-ssse3-asm.S
@ 2026-11-22  2:20 Eric Biggers
  2026-11-22  2:20 ` [PATCH 1/8] lib/crypto: x86/sha512: Partially roll up sha512_transform_ssse3() Eric Biggers
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Eric Biggers @ 2026-11-22  2:20 UTC (permalink / raw)
  To: linux-crypto
  Cc: Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu, x86,
	Eric Biggers

This series reduces the text size of sha512-ssse3-asm.o by over 10 KB,
eliminates an excessively large stack frame that wasn't being zeroized,
and implements various additional optimizations.  Many of these
optimizations were already being used in other code such as
sha512-avx2-asm.o; this older file was just never updated properly.

I don't have access to an x86_64 CPU that lacks AVX2 support, but
running this code on a more recent CPU shows a 30% increase in SHA-512
throughput.  Since the benefit of the 'shld' hack in sha512-avx-asm.S on
Sandy Bridge was allegedly 20%, it's plausible that this more than
closes the gap after the removal of that file.  But even if it doesn't,
it should be a worthwhile cleanup, especially because of the text and
stack size reductions and increased consistency with other files.

Patch 1 is an updated version of
https://lore.kernel.org/linux-crypto/20261112082839.414786-3-ebiggers@kernel.org/

Eric Biggers (8):
  lib/crypto: x86/sha512: Partially roll up sha512_transform_ssse3()
  lib/crypto: x86/sha512: Keep message schedule in XMM registers
  lib/crypto: x86/sha512: Keep W[t]+K[t] in %xmm5 instead of stack
  lib/crypto: x86/sha512: Keep XMM_QWORD_BSWAP in %xmm14 across blocks
  lib/crypto: x86/sha512: Use pshufb for ror64(x, 8) in SSSE3 s0
  lib/crypto: x86/sha512: Keep state in registers across blocks in SSSE3
  lib/crypto: x86/sha512: Shorten critical-path additions in SSSE3
  lib/crypto: x86/sha512: Use local labels for data

 lib/crypto/x86/sha512-ssse3-asm.S | 298 ++++++++++++++++++------------
 1 file changed, 175 insertions(+), 123 deletions(-)


base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726
-- 
2.56.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-22  2:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22  2:20 [PATCH 0/8] lib/crypto: De-bloat and optimize sha512-ssse3-asm.S Eric Biggers
2026-11-22  2:20 ` [PATCH 1/8] lib/crypto: x86/sha512: Partially roll up sha512_transform_ssse3() Eric Biggers
2026-11-22  2:20 ` [PATCH 2/8] lib/crypto: x86/sha512: Keep message schedule in XMM registers Eric Biggers
2026-11-22  2:20 ` [PATCH 3/8] lib/crypto: x86/sha512: Keep W[t]+K[t] in %xmm5 instead of stack Eric Biggers
2026-11-22  2:20 ` [PATCH 4/8] lib/crypto: x86/sha512: Keep XMM_QWORD_BSWAP in %xmm14 across blocks Eric Biggers
2026-11-22  2:20 ` [PATCH 5/8] lib/crypto: x86/sha512: Use pshufb for ror64(x, 8) in SSSE3 s0 Eric Biggers
2026-11-22  2:20 ` [PATCH 6/8] lib/crypto: x86/sha512: Keep state in registers across blocks in SSSE3 Eric Biggers
2026-11-22  2:20 ` [PATCH 7/8] lib/crypto: x86/sha512: Shorten critical-path additions " Eric Biggers
2026-11-22  2:20 ` [PATCH 8/8] lib/crypto: x86/sha512: Use local labels for data Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox