target/i386: implement SHA instructions
commite582b629f0b50c10137ba47c4ca7fe30b3357e3d
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Oct 2023 08:31:17 +0000 (10 10:31 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 Oct 2023 15:35:07 +0000 (25 17:35 +0200)
tree0493ead1dcd8b995d31b488558ded08b22823be5
parent45b5933f7afb055080e915c83663f3a4709a02db
target/i386: implement SHA instructions

The implementation was validated with OpenSSL and with the test vectors in
https://github.com/rust-lang/stdarch/blob/master/crates/core_arch/src/x86/sha.rs.

The instructions provide a ~25% improvement on hashing a 64 MiB file:
runtime goes down from 1.8 seconds to 1.4 seconds; instruction count on
the host goes down from 5.8 billion to 4.8 billion with slightly better
IPC too.  Good job Intel. ;)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c
target/i386/ops_sse.h
target/i386/tcg/decode-new.c.inc
target/i386/tcg/decode-new.h
target/i386/tcg/emit.c.inc
target/i386/tcg/ops_sse_header.h.inc