]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use arm64 sha256 intrinsics in libmd
authorAndrew Turner <andrew@FreeBSD.org>
Fri, 23 Jul 2021 09:14:03 +0000 (10:14 +0100)
committerAndrew Turner <andrew@FreeBSD.org>
Wed, 11 Aug 2021 10:20:48 +0000 (10:20 +0000)
commit69d8dc20be6ca10cf87c98223121c4121aff42cc
tree83f3a36c867360d99b79fe4e12c14cbf4e4a0672
parent89c085b8993d7d1e7b137f99fa6df94c37c3a68a
Use arm64 sha256 intrinsics in libmd

Summary:
When running on a CPU that supports the arm64 sha256 intrinsics use them
to improve perfromance of sha256 calculations.

With this changethe following improvement has been seen on an Apple M1
with FreeBS running under Parallels, with similar results on a
Neoverse-N1 r3p1.

x sha256.orig
+ sha256.arm64
+--------------------------------------------------------------------+
|++                                                               x x|
|+++                                                              xxx|
||A                                                               |A||
+--------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5          3.41           3.5          3.46         3.458   0.042661458
+   5          0.47          0.54           0.5         0.504   0.027018512
Difference at 95.0% confidence
        -2.954 +/- 0.0520768
        -85.4251% +/- 0.826831%
        (Student's t, pooled s = 0.0357071)

Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31284
lib/libmd/Makefile
sys/crypto/sha2/sha256c.c
sys/crypto/sha2/sha256c_arm64.c [new file with mode: 0644]
sys/crypto/sha2/sha256c_impl.h [new file with mode: 0644]