btrfs-progs/crypto
David Sterba 992be8b50a btrfs-progs: crypto: add PCL based implementation for crc32c
Copy faster implementation of crc32c from linux kernel as of 6.5-rc7
(x86_64, arch/x86/crypto/crc32c-pcl-intel-asm_64.S). This needs
assembler build support, so detect target architecture so
cross-compilation still works.

Add a special CPU flag so the old and new implementations can be
benchmarked and verified separately.

Sample benchmark:

CPU flags: 0x1ff
CPU features: SSE2 SSSE3 SSE41 SSE42 SHA AVX AVX2 CRC32C_PCL
Block size:     4096
Iterations:     1000000
Implementation: builtin
Units:          CPU cycles

      NULL-NOP: cycles:     77177218, cycles/i       77
   NULL-MEMCPY: cycles:    226313072, cycles/i      226,    62133.395 MiB/s
    CRC32C-ref: cycles:  24418596066, cycles/i    24418,      575.859 MiB/s
     CRC32C-NI: cycles:   1188335920, cycles/i     1188,    11833.073 MiB/s
    CRC32C-PCL: cycles:    463193456, cycles/i      463,    30358.037 MiB/s
        XXHASH: cycles:    851606646, cycles/i      851,    16511.916 MiB/s
    SHA256-ref: cycles:  74476234956, cycles/i    74476,      188.808 MiB/s
     SHA256-NI: cycles:  34198637428, cycles/i    34198,      411.177 MiB/s
    BLAKE2-ref: cycles:  14761411664, cycles/i    14761,      952.597 MiB/s
   BLAKE2-SSE2: cycles:  18101896796, cycles/i    18101,      776.807 MiB/s
  BLAKE2-SSE41: cycles:  12599091062, cycles/i    12599,     1116.087 MiB/s
   BLAKE2-AVX2: cycles:   9668247506, cycles/i     9668,     1454.418 MiB/s

The new implementation is about 2.5x faster.

Note: there new version does not work on musl because of linkage
problems (relocations in .rodata), so it's still using the old
implementation.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-08-28 17:24:24 +02:00
..
blake2-config.h btrfs-progs: crypto: add AVX2 implementation of BLAKE2 2023-02-28 19:49:29 +01:00
blake2-impl.h btrfs-progs: add blake2b reference implementation 2019-11-18 19:21:05 +01:00
blake2.h btrfs-progs: crypto: move optimized declarations to blake2b.h 2023-05-26 18:02:31 +02:00
blake2b-avx2.c btrfs-progs: crypto: add AVX2 implementation of BLAKE2 2023-02-28 19:49:29 +01:00
blake2b-load-avx2-simple.h btrfs-progs: crypto: add AVX2 implementation of BLAKE2 2023-02-28 19:49:29 +01:00
blake2b-load-avx2.h btrfs-progs: crypto: add AVX2 implementation of BLAKE2 2023-02-28 19:49:29 +01:00
blake2b-load-sse2.h btrfs-progs: crypto: add SSE2 implementation of BLAKE2 2023-02-28 19:48:24 +01:00
blake2b-load-sse41.h btrfs-progs: crypto: add SSE4.1 implementation of BLAKE2 2023-02-28 19:49:06 +01:00
blake2b-ref.c btrfs-progs: crypto: move optimized declarations to blake2b.h 2023-05-26 18:02:31 +02:00
blake2b-round.h btrfs-progs: crypto: fix SSE2/SSE4.1 detection of BLAKE2 2023-03-07 20:50:06 +01:00
blake2b-sse2.c btrfs-progs: crypto: fix SSE2/SSE4.1 detection of BLAKE2 2023-03-07 20:50:06 +01:00
blake2b-sse41.c btrfs-progs: crypto: fix SSE2/SSE4.1 detection of BLAKE2 2023-03-07 20:50:06 +01:00
crc32c-pcl-intel-asm_64.S btrfs-progs: crypto: add PCL based implementation for crc32c 2023-08-28 17:24:24 +02:00
crc32c.c btrfs-progs: crypto: add PCL based implementation for crc32c 2023-08-28 17:24:24 +02:00
crc32c.h btrfs-progs: crypto: use common CPU feature detection for crc32c 2023-02-28 20:11:22 +01:00
hash-speedtest.c btrfs-progs: crypto: add PCL based implementation for crc32c 2023-08-28 17:24:24 +02:00
hash-vectest.c btrfs-progs: crypto: add PCL based implementation for crc32c 2023-08-28 17:24:24 +02:00
hash.c btrfs-progs: fix detection of accelerated implementation. 2023-03-01 15:10:21 +01:00
hash.h btrfs-progs: fix detection of accelerated implementation. 2023-03-01 15:10:21 +01:00
sha-private.h btrfs-progs: move sha256 from tests to crypto/ 2019-11-18 19:20:02 +01:00
sha.h btrfs-progs: crypto: declare SHA256 x86 optimized implementation 2023-05-26 18:02:31 +02:00
sha224-256.c btrfs-progs: fix detection of accelerated implementation. 2023-03-01 15:10:21 +01:00
sha256-x86.c btrfs-progs: crypto: declare SHA256 x86 optimized implementation 2023-05-26 18:02:31 +02:00
xxhash.c btrfs-progs: crypto: update xxhash 2023-02-28 19:49:31 +01:00
xxhash.h btrfs-progs: crypto: update xxhash 2023-02-28 19:49:31 +01:00