* Re: [PATCH v2] lib/crc: arm64: add NEON accelerated CRC64-NVMe implementation
[not found] ` <20260327060211.902077-1-demyansh@gmail.com>
@ 2026-03-27 19:38 ` Eric Biggers
0 siblings, 0 replies; only message in thread
From: Eric Biggers @ 2026-03-27 19:38 UTC (permalink / raw)
To: Demian Shulhan; +Cc: linux-crypto, linux-kernel, ardb, linux-arm-kernel
[+Cc linux-arm-kernel@lists.infradead.org]
Thanks! This is almost ready. Just a few more comments:
On Fri, Mar 27, 2026 at 06:02:11AM +0000, Demian Shulhan wrote:
> - Safely falls back to the generic implementation on Big-Endian systems.
Drop the above bullet point. This patch doesn't explicitly exclude big
endian. Which is correct: Linux arm64 is little-endian-only now.
> + /*
> + * Reduce the 128-bit value to 64 bits.
> + * By multiplying the high 64 bits by x^127 mod G (fold_consts_val[1])
> + * and XORing the result with the low 64 bits.
> + */
That is not what this code does. How about something like:
/* Multiply the 128-bit value by x^64 and reduce it back to 128 bits. */
Granted, that doesn't do a good job explaining it either. However, a
full explanation of this stuff, like the one in the comments in
lib/crc/x86/crc-pclmul-template.S, would be much longer.
I suggest we leave the full explanation for when a similar template is
written for arm64. For now brief comments or even no comments are fine.
Just if any comments are included they really ought to be correct, as
otherwise they are worse than no comments.
> + scoped_ksimd() crc = crc64_nvme_arm64_c(crc, p, chunk);
clang-format doesn't know about scoped_ksimd(), so I suggest overriding
the formatting in this particular case:
scoped_ksimd()
crc = crc64_nvme_arm64_c(crc, p, chunk);
- Eric
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-27 19:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260317065425.2684093-1-demyansh@gmail.com>
[not found] ` <20260327060211.902077-1-demyansh@gmail.com>
2026-03-27 19:38 ` [PATCH v2] lib/crc: arm64: add NEON accelerated CRC64-NVMe implementation Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox