From: Lin Runze Date: Sun, 14 Jan 2024 12:21:49 +0000 (+0800) Subject: Fix performance regression of ChaCha20 on LoongArch64 X-Git-Tag: openssl-3.3.0-alpha1~296 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=971028535e6531c89449e06b1f6862c18f04ff91;p=thirdparty%2Fopenssl.git Fix performance regression of ChaCha20 on LoongArch64 The regression was introduced in PR #22817. In that pull request, the input length check was moved forward, but the related ori instruction was missing, and it will cause input of any length down to the much slower scalar implementation. Fixes #23300 CLA: trivial Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/23301) --- diff --git a/crypto/chacha/asm/chacha-loongarch64.pl b/crypto/chacha/asm/chacha-loongarch64.pl index 9eed5860de9..0a194dd7990 100644 --- a/crypto/chacha/asm/chacha-loongarch64.pl +++ b/crypto/chacha/asm/chacha-loongarch64.pl @@ -71,6 +71,7 @@ ChaCha20_ctr32: # $a4 = arg #5 (counter array) beqz $len,.Lno_data + ori $t3,$zero,64 la.pcrel $t0,OPENSSL_loongarch_hwcap_P ld.w $t0,$t0,0 @@ -461,7 +462,6 @@ EOF $code .= <