mirror of https://github.com/openssl/openssl.git
LoongArch64 assembly pack: add ChaCha20 modules
This assembly implementation for ChaCha20 includes three code paths:
scalar path, 128-bit LSX path and 256-bit LASX path. We prefer the
LASX path or LSX path if the hardware and system support these
extensions.
There are 32 vector registers avaialable in the LSX and LASX
extensions. So, we can load the 16 initial states and the 16
intermediate states of ChaCha into the 32 vector registers for
calculating in the implementation. The test results on the 3A5000
and 3A6000 show that this assembly implementation significantly
improves the performance of ChaCha20 on LoongArch based machines.
The detailed test results are as following.
Test with:
$ openssl speed -evp chacha20
3A5000
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
C code 178484.53k 282789.93k 311793.70k 322234.99k 324405.93k 324659.88k
assembly code 223152.28k 407863.65k 989520.55k 2049192.96k 2127248.70k 2131749.55k
+25% +44% +217% +536% +556% +557%
3A6000
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
C code 214945.33k 310041.75k 340724.22k 349949.27k 352925.01k 353140.74k
assembly code 299151.34k 492766.34k 2070166.02k 4300909.91k 4473978.88k 4499084.63k
+39% +59% +508% +1129% +1168% +1174%
Signed-off-by: Min Zhou <zhoumin@loongson.cn>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21998)
This commit is contained in:
parent
d30695ba4d
commit
9a41a3c6a4
File diff suppressed because it is too large
Load Diff
|
|
@ -12,6 +12,8 @@ IF[{- !$disabled{asm} -}]
|
|||
$CHACHAASM_armv4=chacha-armv4.S
|
||||
$CHACHAASM_aarch64=chacha-armv8.S chacha-armv8-sve.S
|
||||
|
||||
$CHACHAASM_loongarch64=chacha-loongarch64.S
|
||||
|
||||
$CHACHAASM_ppc32=chacha_ppc.c chacha-ppc.s
|
||||
IF[{- $target{sys_id} ne "AIX" && $target{sys_id} ne "MACOSX" -}]
|
||||
$CHACHAASM_ppc32=chacha_ppc.c chacha-ppc.s chachap10-ppc.s
|
||||
|
|
@ -39,8 +41,10 @@ GENERATE[chacha-armv8.S]=asm/chacha-armv8.pl
|
|||
GENERATE[chacha-armv8-sve.S]=asm/chacha-armv8-sve.pl
|
||||
INCLUDE[chacha-armv8.o]=..
|
||||
INCLUDE[chacha-armv8-sve.o]=..
|
||||
INCLUDE[chacha-loongarch64.o]=..
|
||||
INCLUDE[chacha-s390x.o]=..
|
||||
GENERATE[chacha-c64xplus.S]=asm/chacha-c64xplus.pl
|
||||
GENERATE[chacha-s390x.S]=asm/chacha-s390x.pl
|
||||
GENERATE[chacha-ia64.S]=asm/chacha-ia64.pl
|
||||
GENERATE[chacha-ia64.s]=chacha-ia64.S
|
||||
GENERATE[chacha-loongarch64.S]=asm/chacha-loongarch64.pl
|
||||
|
|
|
|||
Loading…
Reference in New Issue