aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-10-22 23:50:38 -0700
committerCody Tapscott <topolarity@tapscott.me>2022-10-28 15:21:10 -0700
commit10edb6d352173dfbc9962ce3db064384319e77f8 (patch)
tree84b964d90c0488872a9ec56b856910aef82f3e2c /src
parentc616141241047d6d6c811d43f644eb1b7d2b26ce (diff)
downloadzig-10edb6d352173dfbc9962ce3db064384319e77f8.tar.gz
zig-10edb6d352173dfbc9962ce3db064384319e77f8.zip
crypto.sha2: Use intrinsics for SHA-256 on x86-64 and AArch64
There's probably plenty of room to optimize these further in the future, but for the moment this gives ~3x improvement on Intel x86-64 processors, ~5x on AMD, and ~10x on M1 Macs. These extensions are very new - Most processors prior to 2020 do not support them. AVX-512 is a slightly older alternative that we could use on Intel for a much bigger performance bump, but it's been fused off on Intel's latest hybrid architectures and it relies on computing independent SHA hashes in parallel. In contrast, these SHA intrinsics provide the usual single-threaded, single-stream interface, and should continue working on new processors. AArch64 also has SHA-512 intrinsics that we could take advantage of in the future
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions