Linux cryptographic layer development
 help / color / mirror / Atom feed
* lib/crc: x86/crc32c: question about the "Future work" note (crc32q + VPCLMULQDQ on Zen)
@ 2026-11-14  3:27 parker
  2026-11-14  5:23 ` Eric Biggers
  0 siblings, 1 reply; 2+ messages in thread
From: parker @ 2026-11-14  3:27 UTC (permalink / raw)
  To: ebiggers; +Cc: linux-crypto, ardb

Hi Eric,

There's a comment in crc32c_arch() in lib/crc/x86/crc32.h that says that
the optimal strategy on Zen 3--5 is to use crc32q and VPCLMULQDQ in
parallel, but that different numbers of streams and vector lengths are
optimal on each microarchitecture.  I've been experimenting with this on
Zen 5, and am curious about what you're looking for here.

I've tuned an impl for Zen 5 only: two zmm registers folding with
VPCLMULQDQ while four crc32q streams run alongside, merged at the end
using multipliers from a 1 KiB table.  Compared with
crc32_lsb_vpclmul_avx512() at len=4096:

    AMD Ryzen 7 9800X3D (Zen 5)            +53%   (crc_kunit)
    AMD EPYC 9V45 (Zen 5)                  +57%   (userspace)
    AMD EPYC 9V74 (Zen 4)                  +15%, but slower at len=1024
    Intel Xeon 6975P-C (Granite Rapids)    -43%


1. What would you want a solution to look like?  A variant per
   microarchitecture, a single variant for whichever one is worth it, or
   nothing until there's an approach that covers several of them?

2. Would a Zen 5-only variant be acceptable for now?


Thanks,
Parker


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-14  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14  3:27 lib/crc: x86/crc32c: question about the "Future work" note (crc32q + VPCLMULQDQ on Zen) parker
2026-11-14  5:23 ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox