Page MenuHomeFreeBSD

lib/libmd: reimplement and enhance md5
Changes PlannedPublic

Authored by fuz on Jun 21 2024, 10:27 AM.
Tags
None
Referenced Files
F98968081: D45670.diff
Sat, Oct 5, 1:38 PM
Unknown Object (File)
Thu, Oct 3, 12:22 PM
Unknown Object (File)
Wed, Oct 2, 4:10 PM
Unknown Object (File)
Wed, Oct 2, 12:18 PM
Unknown Object (File)
Wed, Oct 2, 4:00 AM
Unknown Object (File)
Mon, Sep 30, 4:23 AM
Unknown Object (File)
Tue, Sep 24, 8:36 AM
Unknown Object (File)
Mon, Sep 23, 7:05 AM
Subscribers

Details

Summary

The reimplementation is a bit cleaner than the original code,
although it is also slightly slower. This shouldn't matter too
much as we have asm code for the major platforms.

Optimised implementations are provided for amd64 and aarch64.
For amd64, we have three implementations. One for baseline,
one using ANDN from BMI1 and one using AVX-512 (though it's not
really vectorised). Here's the performance:

11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz:

pre	17.0s (602 MB/s)
generic	18.8s (545 MB/s)
scalar	13.4s (764 MB/s)
bmi1	12.0s (853 MB/s)
avx512	10.6s (966 MB/s)

ARM Cortex-X1C (Windows 2023 Dev Kit perf core):

pre	35.2s (291 MB/s)
generic	36.4s (281 MB/s)
scalar	34.5s (297 MB/s)

ARM Cortex-A78C (Windows 2023 Dev Kit efficiency core):

pre	46.8s (219 MB/s)
generic	47.3s (216 MB/s)
scalar	44.5s (230 MB/s)

This changeset will have to be reworked when D34497 lands.
I'm not sure how to apply the SIMD code to all uses of MD5.

This changeset anticipates D34498 and no longer provides the
transform and block symbols.

Obtained from: https://github.com/animetosho/md5-optimisation/

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 58276
Build 55164: arc lint + arc unit

Event Timeline

fuz requested review of this revision.Jun 21 2024, 10:27 AM
lwhsu added inline comments.
lib/libmd/aarch64/md5block.S
4

The order is SPDX then owner from style(9).

fuz planned changes to this revision.Tue, Oct 1, 3:29 PM

Needs to be refactored after the libmd rework.