diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2019-09-15 22:48:38 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2019-09-15 22:52:07 +0300 |
commit | 0486b85bd1fb65013e77f858cae9ea4530f868df (patch) | |
tree | 18ba46bd149f34f815f58c104951611cfc4f24d1 /configure.ac | |
parent | 557702f0d53a7ad1cf2ce0333c9df799a8abad59 (diff) | |
download | libgcrypt-0486b85bd1fb65013e77f858cae9ea4530f868df.tar.gz |
Add PowerPC vpmsum implementation of CRC
* cipher/Makefile.am: Add 'crc-ppc.c'.
* cipher/crc-armv8-ce.c: Remove 'USE_INTEL_PCLMUL' comment.
* cipher/crc-ppc.c: New.
* cipher/crc.c (USE_PPC_VPMSUM): New.
(CRC_CONTEXT): Add 'use_vpmsum'.
(_gcry_crc32_ppc8_vpmsum, _gcry_crc24rfc2440_ppc8_vpmsum): New.
(crc32_init, crc24rfc2440_init): Add HWF check for 'use_vpmsum'.
(crc32_write, crc24rfc2440_write): Add 'use_vpmsum' code-path.
* configure.ac: Add 'vpmsumd' instruction to PowerPC VSX inline
assembly check; Add 'crc-ppc.lo'.
--
Benchmark on POWER8 (ppc64le, ~3.8Ghz):
Before:
| nanosecs/byte mebibytes/sec cycles/byte
CRC32 | 0.978 ns/B 975.0 MiB/s 3.72 c/B
CRC24RFC2440 | 0.974 ns/B 978.8 MiB/s 3.70 c/B
After(~22x faster):
| nanosecs/byte mebibytes/sec cycles/byte
CRC32 | 0.044 ns/B 21878 MiB/s 0.166 c/B
CRC24RFC2440 | 0.043 ns/B 22077 MiB/s 0.164 c/B
Benchmark on POWER9 (ppc64le, ~3.8Ghz):
Before:
| nanosecs/byte mebibytes/sec cycles/byte
CRC32 | 1.01 ns/B 943.7 MiB/s 3.84 c/B
CRC24RFC2440 | 0.993 ns/B 960.6 MiB/s 3.77 c/B
After (~20x faster):
| nanosecs/byte mebibytes/sec cycles/byte
CRC32 | 0.046 ns/B 20675 MiB/s 0.175 c/B
CRC24RFC2440 | 0.048 ns/B 19691 MiB/s 0.184 c/B
GnuPG-bug-id: 4460
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 6333076b..75ec8216 100644 --- a/configure.ac +++ b/configure.ac @@ -1908,6 +1908,7 @@ AC_CACHE_CHECK([whether GCC inline assembler supports PowerPC AltiVec/VSX/crypto "vadduwm %v0, %v1, %v22;\n" "vshasigmaw %v0, %v1, 0, 15;\n" "vshasigmad %v0, %v1, 0, 15;\n" + "vpmsumd %v11, %v11, %v11;\n" ); ]])], [gcry_cv_gcc_inline_asm_ppc_altivec=yes]) @@ -2564,6 +2565,15 @@ if test "$found" = "1" ; then GCRYPT_CIPHERS="$GCRYPT_CIPHERS crc-armv8-ce.lo" GCRYPT_CIPHERS="$GCRYPT_CIPHERS crc-armv8-aarch64-ce.lo" ;; + powerpc64le-*-*) + GCRYPT_CIPHERS="$GCRYPT_CIPHERS crc-ppc.lo" + ;; + powerpc64-*-*) + GCRYPT_CIPHERS="$GCRYPT_CIPHERS crc-ppc.lo" + ;; + powerpc-*-*) + GCRYPT_CIPHERS="$GCRYPT_CIPHERS crc-ppc.lo" + ;; esac fi |