HomeFreeBSD

amd64: implement memcmp in assembly

Description

amd64: implement memcmp in assembly

Both the in-kernel C variant and libc asm variant have very poor performance.
The former compiles to a single byte comparison loop, which breaks down even
for small sizes. The latter uses rep cmpsq/b which turn out to have very poor
throughput and are slower than a hand-coded 32-byte comparison loop.

Depending on size this is about 3-4 times faster than the current routines.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17328

Details

Provenance
mjgAuthored on
Reviewer
kib
Differential Revision
D17328: amd64: implement memcmp in assembly
Parents
rS338962: Export ID_AA64PFR0_EL1 to userland
Branches
Unknown
Tags
Unknown