]> git.ipfire.org Git - thirdparty/linux.git/commit
lib/crc: arm64: Simplify intrinsics implementation
authorArd Biesheuvel <ardb@kernel.org>
Mon, 30 Mar 2026 14:46:35 +0000 (16:46 +0200)
committerEric Biggers <ebiggers@kernel.org>
Thu, 2 Apr 2026 23:14:53 +0000 (16:14 -0700)
commit8fdef85d601db670e9c178314eedffe7bbb07e52
tree37710eb307736c30f849ba5b5f5cebaeb6451003
parentf956dc813144baf8bd2d77eec61b90bc00c10894
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>
lib/crc/arm64/crc64-neon-inner.c