HomeFreeBSD

Use arm64 sha256 intrinsics in libmd

Description

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
AA

+--------------------------------------------------------------------+

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

(cherry picked from commit 69d8dc20be6ca10cf87c98223121c4121aff42cc)

Details

Provenance
andrewAuthored on Jul 23 2021, 9:14 AM
Reviewer
cem
Differential Revision
D31284: Use arm64 sha256 intrinsics in libmd
Parents
rGac5552473050: pcf8591: remove write-only variables
Branches
Unknown
Tags
Unknown