Re: [PATCH] lib/crc: Add 4-way folding in NEON crc64_nvme implementation

From: Shreesh Adiga

Date: Sun Nov 22 2026 - 03:32:11 EST


On Sun, Nov 22, 2026 at 2:16 AM Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
> Note that an AArch32 implementation of fold_partial_block() is possible,
> e.g. vqtbl1q_u8() could be replaced with two vtbl2_u8(). Normally I'd
> consider an AArch32 specific optimization not worth including, but it
> might be worthwhile here since it would avoid divergence in the code due
> to the following arch-specific precondition:
>
> /* Assumes len >= 64. AArch32 also assumes len is multiple of 16. */
>
> > lib/crc/arm64/crc64-neon.h | 15 +++---
> > lib/crc/arm64/crc64.h | 18 ++++---
> > lib/crc/crc64-neon.c | 96 +++++++++++++++++++++++++++++++++++---
> > 3 files changed, 110 insertions(+), 19 deletions(-)
>
> Anyway, I've applied this patch to
> https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=crc-next
>
> In general I'd prefer better comments in the code though, especially
> documenting nonobvious decisions like why pmull and pmull2 are accessed
> using inline asm instead of intrinsics.
>
> So if you'd like to do a follow-up patch, it could be worthwhile to
> address the above two issues.

Okay have submitted follow-up patch for implementing the partial block
for AArch32 and include some more documentation and making it
consistent on both 64 and 32 bit.
Once this is merged then will start looking into EOR3 support. If you
have further suggestions, then do let me know!

Thanks,
Shreesh