]> git.ipfire.org Git - thirdparty/openssl.git/commit
Enable x86-64 SHA-512 family optimizations with SHA512 ISA extension
authorStanciu, Adrian <adrian.stanciu@intel.com>
Tue, 11 Feb 2025 21:14:55 +0000 (13:14 -0800)
committerPauli <ppzgs1@gmail.com>
Thu, 3 Apr 2025 00:14:42 +0000 (11:14 +1100)
commit196b36f0d0c8bc9d227cb6ef2cc48fd6f4ed8c7e
tree4ed4dd6190bc02f9a72a8f5f66d5a0b754ee9890
parente1eb6fdb3a42eb62b9606b208bb0d2c710c30a9c
Enable x86-64 SHA-512 family optimizations with SHA512 ISA extension
The SHA-256 (SZ=4) and SHA-512 (SZ=8) dispatcher paths have been
separated while keeping the SHA-256 path unmodified.

Due to early constraints in register availability, two 32-bit
`OPENSSL_ia32cap_P` reads have been coalesced into one. As a
consequence, several bit positions used in feature checks have gained a
32 bits offset.

Replaced `test` with `bt` to allow use of 64-bit immediate indices in
CPUID feature checks.

Split the SHA512 BMI2+AVX2+BMI1 dispatcher branch into:
- AVX2+SHA512: high priority, with SHA512 ISA extension
- AVX2+BMI2+BMI1: fallback

The added implementation has its own copy of `K512` without duplicated
elements every 16 bytes. Shuffle indices have been reused from `K512`.

Added binary translators for `vsha512msg1`, `vsha512msg2`,
`vsha512rnds2` for older assemblers.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26147)
CHANGES.md
crypto/sha/asm/sha512-x86_64.pl