crypto: x86/crc32c - simplify code for handling fewer than 200 bytes
authorEric Biggers <ebiggers@google.com>
Mon, 14 Oct 2024 04:24:45 +0000 (21:24 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 26 Oct 2024 06:41:59 +0000 (14:41 +0800)
commit84ebf9dbe652355461b3e2f4693ce7b7402c30ca
tree039f411fbe1b5ab7a55bee3d5fbbf8efcb46d06c
parent0a53948477ca1dc0239b468f24e85f6ceef29733
crypto: x86/crc32c - simplify code for handling fewer than 200 bytes

The assembly code in crc32c-pcl-intel-asm_64.S is invoked only for
lengths >= 512, due to the overhead of saving and restoring FPU state.
Therefore, it is unnecessary for this code to be excessively "optimized"
for lengths < 200.  Eliminate the excessive unrolling of this part of
the code and use a more straightforward qword-at-a-time loop.

Note: the part of the code in question is not entirely redundant, as it
is still used to process any remainder mod 24, as well as any remaining
data when fewer than 200 bytes remain after least one 3072-byte chunk.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/crc32c-pcl-intel-asm_64.S