mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
Move and rename the CRC64 NEON intrinsics implementation source file and rename the function name to reflect that it is NEON code that can be shared. This will be wired up for 32-bit ARM in a subsequent patch. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260422171655.3437334-14-ardb+git@google.com Signed-off-by: Eric Biggers <ebiggers@kernel.org>
29 lines
606 B
C
29 lines
606 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* CRC64 using ARM64 PMULL instructions
|
|
*/
|
|
|
|
#include <linux/cpufeature.h>
|
|
#include <asm/simd.h>
|
|
#include <linux/minmax.h>
|
|
#include <linux/sizes.h>
|
|
|
|
u64 crc64_nvme_neon(u64 crc, const u8 *p, size_t len);
|
|
|
|
#define crc64_be_arch crc64_be_generic
|
|
|
|
static inline u64 crc64_nvme_arch(u64 crc, const u8 *p, size_t len)
|
|
{
|
|
if (len >= 128 && cpu_have_named_feature(PMULL) &&
|
|
likely(may_use_simd())) {
|
|
size_t chunk = len & ~15;
|
|
|
|
scoped_ksimd()
|
|
crc = crc64_nvme_neon(crc, p, chunk);
|
|
|
|
p += chunk;
|
|
len &= 15;
|
|
}
|
|
return crc64_nvme_generic(crc, p, len);
|
|
}
|