linux/lib/crc
Ard Biesheuvel 8fdef85d60 lib/crc: arm64: Simplify intrinsics implementation
NEON intrinsics are useful because they remove the need for manual
register allocation, and the resulting code can be re-compiled and
optimized for different micro-architectures, and shared between arm64
and 32-bit ARM.

However, the strong typing of the vector variables can lead to
incomprehensible gibberish, as is the case with the new CRC64
implementation. To address this, let's repaint all variables as
uint64x2_t to minimize the number of vreinterpretq_xxx() calls, and to
be able to rely on the ^ operator for exclusive OR operations. This
makes the code much more concise and readable.

While at it, wrap the calls to vmull_p64() et al in order to have a more
consistent calling convention, and encapsulate any remaining
vreinterpret() calls that are still needed.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260330144630.33026-11-ardb@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-04-02 16:14:53 -07:00
..
arm lib/crc: Switch ARM and arm64 to 'ksimd' scoped guard API 2025-11-12 09:52:01 +01:00
arm64 lib/crc: arm64: Simplify intrinsics implementation 2026-04-02 16:14:53 -07:00
loongarch lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
mips lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
powerpc lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
riscv lib/crc: riscv: Migrate optimized CRC code into lib/crc/ 2025-06-30 09:31:57 -07:00
s390 lib/crc: s390: Migrate optimized CRC code into lib/crc/ 2025-06-30 09:31:57 -07:00
sparc lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
tests lib/crc: tests: Make crc_kunit test only the enabled CRC variants 2026-03-09 13:29:46 -07:00
x86 lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
.gitignore
.kunitconfig lib/crc: tests: Add a .kunitconfig file 2026-03-09 13:29:47 -07:00
Kconfig lib/crc: arm64: add NEON accelerated CRC64-NVMe implementation 2026-03-29 13:22:13 -07:00
Makefile lib/crc: arm64: Use existing macros for kernel-mode FPU cflags 2026-04-02 16:14:53 -07:00
crc-ccitt.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc-itu-t.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc-t10dif-main.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc4.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc7.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc8.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc16.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc32-main.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc64-main.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
gen_crc32table.c
gen_crc64table.c