btrfs-progs/crypto
David Sterba 3d9217f7ab btrfs-progs: hash-speedtest: select implementation by features
Now put all the recent changes into action. Add a callback that will
reinitialize the implementation pointers according to the desired
feature. Reference implementations use the NONE CPU flag to distinguish
them from the rest.

Example results:

$ hash-speedtest
CPU flags: 0xff
CPU features: SSE2 SSSE3 SSE41 SSE42 SHA AVX AVX2
Block size:     4096
Iterations:     1000000
Implementation: builtin
Units:          CPU cycles

    NULL-NOP: cycles:     67129026, cycles/i       67
 NULL-MEMCPY: cycles:    231303654, cycles/i      231,    60792.500 MiB/s
  CRC32C-ref: cycles:  23982698042, cycles/i    23982,      586.322 MiB/s
   CRC32C-NI: cycles:   1168017624, cycles/i     1168,    12038.828 MiB/s
      XXHASH: cycles:    838434468, cycles/i      838,    16771.152 MiB/s
  SHA256-ref: cycles:  68296865380, cycles/i    68296,      205.889 MiB/s
   SHA256-NI: cycles:  29748853920, cycles/i    29748,      472.676 MiB/s
  BLAKE2-ref: cycles:  14532177414, cycles/i    14532,      967.617 MiB/s
 BLAKE2-SSE2: cycles:  17762215810, cycles/i    17762,      791.657 MiB/s
BLAKE2-SSE41: cycles:  12370044656, cycles/i    12370,     1136.744 MiB/s
 BLAKE2-AVX2: cycles:   9472823338, cycles/i     9472,     1484.412 MiB/s

Previously:

Block size:     4096
Iterations:     1000000
Implementation: builtin
Units:          CPU cycles

    NULL-NOP: cycles:     67714016, cycles/i       67
 NULL-MEMCPY: cycles:    234140818, cycles/i      234,    60055.762 MiB/s
      CRC32C: cycles:   1187358432, cycles/i     1187,    11842.733 MiB/s
      XXHASH: cycles:   1897530684, cycles/i     1897,     7410.448 MiB/s
      SHA256: cycles:  69855340702, cycles/i    69855,      201.296 MiB/s
      BLAKE2: cycles:  14713130972, cycles/i    14713,      955.716 MiB/s

The CPU is i7-11700 3.60GHz and not the same as previous results
mentioned in changelogs so the results are incomparable. Otherwise, the
updated xxhash implementation is twice as fast, no significant changes
for the rest.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-02-28 20:11:22 +01:00
..
blake2-config.h btrfs-progs: crypto: add AVX2 implementation of BLAKE2 2023-02-28 19:49:29 +01:00
blake2-impl.h
blake2.h btrfs-progs: crypto: call blake2 implementations by pointer 2023-02-28 19:53:43 +01: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: call blake2 implementations by pointer 2023-02-28 19:53:43 +01:00
blake2b-round.h btrfs-progs: crypto: add SSE2 implementation of BLAKE2 2023-02-28 19:48:24 +01:00
blake2b-sse2.c btrfs-progs: crypto: add SSE2 implementation of BLAKE2 2023-02-28 19:48:24 +01:00
blake2b-sse41.c btrfs-progs: crypto: add SSE4.1 implementation of BLAKE2 2023-02-28 19:49:06 +01:00
crc32c.c btrfs-progs: crypto: use common CPU feature detection for crc32c 2023-02-28 20:11:22 +01: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: hash-speedtest: select implementation by features 2023-02-28 20:11:22 +01:00
hash-vectest.c btrfs-progs: crypto: test all implementations 2023-02-28 19:49:30 +01:00
hash.c btrfs-progs: crypto: use common CPU feature detection for crc32c 2023-02-28 20:11:22 +01:00
hash.h btrfs-progs: crypto: use common CPU feature detection for crc32c 2023-02-28 20:11:22 +01:00
sha224-256.c btrfs-progs: crypto: call sha256 implementations by pointer 2023-02-28 20:10:58 +01:00
sha256-x86.c btrfs-progs: crypto: add accelerated SHA256 implementation 2023-02-28 19:49:30 +01:00
sha-private.h
sha.h btrfs-progs: crypto: call sha256 implementations by pointer 2023-02-28 20:10:58 +01: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