Commit Graph
893 Commits
Author SHA1 Message Date
Nigel Tao b24e046670 Replace SIMD CRC-32 k6' magic constant with Px'
This is just a change of name (and a change of comment), not a change of
value.

From my colleague, Eric Biggers:

The number is not k6' = (x^32 mod P(x) << 32)' << 1 = 0x1DB710640, but
rather P(x)' = 0x1DB710641. This value represents the generator
polynomial of CRC-32 as a 33-bit value, using the CRC-32 bit ordering
convention (lowest order bit = coefficient of highest order polynomial
term). The lowest order bit is the coefficient of x^32, which by
definition is 1 for CRC-32. P(x) is used as a multiplicand in Barrett
reduction, which is the step which reduces a 64-bit value to the final
32-bit remainder. See "Algorithm 1" in the Gopal paper.

The reason that last bit doesn't actually matter is because the output
of the Barrett reduction is supposed to be fully reduced mod P(x), so
only 32 bits (the bits that represent the coefficients of x^0..x^31) are
supposed to be able to be nonzero. Therefore, in practice
implementations will just truncate the result to 32 bits. Incorrectly
using 0x1DB710640 rather than P(x) = 0x1DB710641 only causes the result
to be wrong by a factor of x^32, so it doesn't affect those 32 bits.
2021-03-18 11:21:51 +11:00
Nigel Tao 16b4b7554b Link to SIMD CRC-32 k6' magic constant blog post 2021-03-18 11:06:21 +11:00
Nigel Tao 385c34930a Check 8-byte-chunk copy distance precondition 2021-03-11 22:54:06 +11:00
Nigel Tao 4e3a005d28 Use 8-byte-chunk copy for decode_huffman_fast32
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_deflate_decode_1k_full_init/clang9                  45.1MB/s ± 5%   47.2MB/s ± 6%     ~     (p=0.151 n=5+5)
wuffs_deflate_decode_1k_part_init/clang9                  60.6MB/s ± 0%   64.2MB/s ± 0%   +5.94%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang9                 82.0MB/s ± 1%  104.8MB/s ± 1%  +27.75%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang9                 87.9MB/s ± 0%  114.4MB/s ± 0%  +30.13%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang9             111MB/s ± 0%    139MB/s ± 0%  +26.03%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang9           60.2MB/s ± 0%   63.3MB/s ± 0%   +5.28%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k_full_init/gcc8                    45.8MB/s ± 3%   47.4MB/s ± 1%   +3.38%  (p=0.032 n=5+5)
wuffs_deflate_decode_1k_part_init/gcc8                    63.0MB/s ± 1%   62.8MB/s ± 1%     ~     (p=0.151 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc8                   87.9MB/s ± 0%  102.9MB/s ± 1%  +17.08%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc8                   95.3MB/s ± 0%  111.5MB/s ± 0%  +17.03%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc8               115MB/s ± 0%    130MB/s ± 0%  +12.38%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc8             58.9MB/s ± 0%   60.1MB/s ± 0%   +1.94%  (p=0.008 n=5+5)

mimic_deflate_decode_1k                                   77.7MB/s ± 1%   77.2MB/s ± 1%     ~     (p=0.222 n=5+5)
mimic_deflate_decode_10k                                   114MB/s ± 0%    114MB/s ± 1%     ~     (p=0.548 n=5+5)
mimic_deflate_decode_100k_just_one_read                    158MB/s ± 0%    158MB/s ± 0%     ~     (p=0.056 n=5+5)
mimic_deflate_decode_100k_many_big_reads                   113MB/s ± 0%    113MB/s ± 0%     ~     (p=0.690 n=5+5)

----

wuffs_gzip_decode_10k/clang9                              91.4MB/s ± 0%  106.9MB/s ± 0%  +16.93%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang9                              113MB/s ± 0%    128MB/s ± 0%  +13.01%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/gcc8                                92.2MB/s ± 0%  109.7MB/s ± 0%  +19.00%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc8                                111MB/s ± 0%    119MB/s ± 0%   +7.43%  (p=0.008 n=5+5)

mimic_gzip_decode_10k                                     98.2MB/s ± 0%   98.1MB/s ± 0%     ~     (p=0.222 n=5+5)
mimic_gzip_decode_100k                                     128MB/s ± 0%    128MB/s ± 0%   +0.11%  (p=0.008 n=5+5)

----

wuffs_zlib_decode_10k/clang9                              90.8MB/s ± 0%  111.5MB/s ± 0%  +22.86%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/clang9                              108MB/s ± 0%    134MB/s ± 0%  +23.90%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc8                                92.3MB/s ± 0%  108.2MB/s ± 0%  +17.15%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc8                                112MB/s ± 0%    119MB/s ± 0%   +6.90%  (p=0.008 n=5+5)

mimic_zlib_decode_10k                                      108MB/s ± 0%    108MB/s ± 0%   +0.39%  (p=0.008 n=5+5)
mimic_zlib_decode_100k                                     143MB/s ± 0%    141MB/s ± 0%   -1.28%  (p=0.008 n=5+5)

----

wuffs_png_decode_image_19k_8bpp/clang9                    72.4MB/s ± 0%   81.9MB/s ± 0%  +13.10%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9                    104MB/s ± 0%    104MB/s ± 0%   -0.40%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     274MB/s ± 0%    301MB/s ± 0%   +9.80%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   165MB/s ± 0%    183MB/s ± 0%  +10.96%  (p=0.016 n=4+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   160MB/s ± 1%    178MB/s ± 0%  +11.28%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                 98.1MB/s ± 0%   98.9MB/s ± 0%   +0.82%  (p=0.016 n=5+4)

wuffs_png_decode_image_19k_8bpp/gcc8                      73.5MB/s ± 0%   80.4MB/s ± 0%   +9.33%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc8                      104MB/s ± 0%    106MB/s ± 0%   +1.73%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc8                       248MB/s ± 0%    272MB/s ± 0%   +9.67%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc8     163MB/s ± 0%    177MB/s ± 0%   +8.89%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc8     157MB/s ± 0%    170MB/s ± 0%   +8.42%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc8                   98.6MB/s ± 0%  100.9MB/s ± 0%   +2.29%  (p=0.008 n=5+5)

mimic_png_decode_image_19k_8bpp                           43.7MB/s ± 0%   43.7MB/s ± 0%     ~     (p=0.690 n=5+5)
mimic_png_decode_image_40k_24bpp                          54.6MB/s ± 0%   54.6MB/s ± 0%     ~     (p=0.151 n=5+5)
mimic_png_decode_image_77k_8bpp                            125MB/s ± 0%    124MB/s ± 0%   -0.28%  (p=0.008 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          102MB/s ± 0%    102MB/s ± 0%     ~     (p=0.238 n=5+5)
mimic_png_decode_image_4002k_24bpp                        81.7MB/s ± 0%   81.8MB/s ± 0%   +0.09%  (p=0.008 n=5+5)
2021-03-08 15:41:48 +11:00
Nigel Tao b58a961acb Add etc_copy_u32_from_history_8_byte_chunks_fast
On a mid-range x86_64 laptop:

----

$ ls -lh linux-5.11.3.tar.gz | awk '{print $5 " " $9}'
178M linux-5.11.3.tar.gz

$ # Debian's /usr/bin/zcat
$ time /usr/bin/zcat        < linux-5.11.3.tar.gz > /dev/null
real	0m8.423s

$ # Wuffs; before
$ time gen/bin/example-zcat < linux-5.11.3.tar.gz > /dev/null
real	0m4.054s

$ # Wuffs; after
$ time gen/bin/example-zcat < linux-5.11.3.tar.gz > /dev/null
real	0m2.651s

----

Wuffs benchmarks:

wuffs_deflate_decode_1k_full_init/clang9                  95.6MB/s ± 0%  98.1MB/s ± 1%   +2.62%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/clang9                   109MB/s ± 0%   112MB/s ± 0%   +3.31%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang9                  162MB/s ± 0%   201MB/s ± 0%  +24.32%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang9                  165MB/s ± 0%   206MB/s ± 0%  +25.16%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang9             170MB/s ± 0%   253MB/s ± 0%  +48.63%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang9            147MB/s ± 0%   160MB/s ± 0%   +8.77%  (p=0.016 n=4+5)

wuffs_deflate_decode_1k_full_init/gcc10                   92.1MB/s ± 0%  91.7MB/s ± 0%   -0.44%  (p=0.016 n=5+5)
wuffs_deflate_decode_1k_part_init/gcc10                    107MB/s ± 0%   104MB/s ± 0%   -3.35%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc10                   149MB/s ± 0%   195MB/s ± 0%  +30.68%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc10                   152MB/s ± 1%   199MB/s ± 1%  +31.23%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc10              213MB/s ± 0%   256MB/s ± 0%  +20.42%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc10             177MB/s ± 0%   177MB/s ± 1%     ~     (p=0.595 n=5+5)

mimic_deflate_decode_1k                                    128MB/s ± 0%   128MB/s ± 0%   +0.42%  (p=0.016 n=5+4)
mimic_deflate_decode_10k                                   143MB/s ± 0%   143MB/s ± 0%     ~     (p=0.310 n=5+5)
mimic_deflate_decode_100k_just_one_read                    176MB/s ± 0%   176MB/s ± 0%   -0.24%  (p=0.008 n=5+5)
mimic_deflate_decode_100k_many_big_reads                   135MB/s ± 0%   135MB/s ± 0%   +0.12%  (p=0.016 n=5+5)

----

wuffs_gzip_decode_10k/clang9                               166MB/s ± 0%   198MB/s ± 1%  +19.66%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang9                              178MB/s ± 0%   241MB/s ± 0%  +35.41%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/gcc10                                172MB/s ± 0%   199MB/s ± 0%  +15.67%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc10                               198MB/s ± 0%   258MB/s ± 0%  +29.95%  (p=0.008 n=5+5)

mimic_gzip_decode_10k                                      121MB/s ± 0%   121MB/s ± 0%     ~     (p=0.421 n=5+5)
mimic_gzip_decode_100k                                     144MB/s ± 0%   144MB/s ± 0%     ~     (p=0.548 n=5+5)

----

wuffs_zlib_decode_10k/clang9                               154MB/s ± 0%   199MB/s ± 0%  +28.89%  (p=0.016 n=4+5)
wuffs_zlib_decode_100k/clang9                              186MB/s ± 1%   234MB/s ± 1%  +25.58%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc10                                156MB/s ± 0%   202MB/s ± 0%  +30.01%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc10                               198MB/s ± 0%   262MB/s ± 0%  +32.21%  (p=0.008 n=5+5)

mimic_zlib_decode_10k                                      133MB/s ± 0%   133MB/s ± 0%     ~     (p=1.000 n=5+5)
mimic_zlib_decode_100k                                     160MB/s ± 0%   160MB/s ± 0%     ~     (p=0.095 n=5+5)

----

wuffs_png_decode_image_19k_8bpp/clang9                     115MB/s ± 0%   131MB/s ± 0%  +14.45%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9                    153MB/s ± 0%   153MB/s ± 0%   -0.51%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     415MB/s ± 0%   474MB/s ± 0%  +14.37%  (p=0.016 n=4+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   345MB/s ± 1%   371MB/s ± 0%   +7.62%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   335MB/s ± 0%   359MB/s ± 0%   +7.06%  (p=0.016 n=4+5)
wuffs_png_decode_image_4002k_24bpp/clang9                  153MB/s ± 0%   156MB/s ± 0%   +2.37%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/gcc10                      123MB/s ± 0%   135MB/s ± 1%   +9.38%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc10                     159MB/s ± 1%   163MB/s ± 0%   +2.60%  (p=0.016 n=5+4)
wuffs_png_decode_image_77k_8bpp/gcc10                      452MB/s ± 0%   479MB/s ± 0%   +6.00%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    353MB/s ± 0%   387MB/s ± 0%   +9.42%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    341MB/s ± 0%   372MB/s ± 0%   +9.07%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc10                   161MB/s ± 0%   164MB/s ± 0%   +1.86%  (p=0.016 n=4+5)

mimic_png_decode_image_19k_8bpp                           58.1MB/s ± 0%  58.2MB/s ± 0%   +0.22%  (p=0.008 n=5+5)
mimic_png_decode_image_40k_24bpp                          73.2MB/s ± 0%  73.2MB/s ± 0%     ~     (p=0.341 n=5+5)
mimic_png_decode_image_77k_8bpp                            177MB/s ± 0%   177MB/s ± 0%     ~     (p=0.095 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          147MB/s ± 0%   146MB/s ± 0%     ~     (p=0.056 n=5+5)
mimic_png_decode_image_4002k_24bpp                         104MB/s ± 0%   104MB/s ± 0%     ~     (p=0.841 n=4+5)
2021-03-08 13:19:39 +11:00
Nigel Tao 79c7ba0ae9 Add script/print-crc32-x86-sse42-magic-numbers.go 2021-03-07 22:18:52 +11:00
Nigel Tao 5d4fbc3ac6 Implement std/crc32 ieee_hasher.up_x86_sse42
On a mid-range x86_64 laptop:

----

$ ls -lh linux-5.11.3.tar.gz | awk '{print $5 " " $9}'
178M linux-5.11.3.tar.gz

$ # Debian's /usr/bin/crc32
$ time /usr/bin/crc32 /dev/stdin < linux-5.11.3.tar.gz > /dev/null
real    0m0.411s

$ # Wuffs; before
$ time gen/bin/example-crc32     < linux-5.11.3.tar.gz > /dev/null
real    0m0.137s

$ # Wuffs; after
$ time gen/bin/example-crc32     < linux-5.11.3.tar.gz > /dev/null
real    0m0.060s

----

Wuffs benchmarks:

wuffs_crc32_ieee_10k/clang9                               1.71GB/s ± 0%   8.40GB/s ± 3%  +391.97%  (p=0.008 n=5+5)
wuffs_crc32_ieee_100k/clang9                              1.73GB/s ± 1%  10.67GB/s ± 0%  +518.47%  (p=0.008 n=5+5)

wuffs_crc32_ieee_10k/gcc10                                2.08GB/s ± 0%   8.77GB/s ± 0%  +322.05%  (p=0.008 n=5+5)
wuffs_crc32_ieee_100k/gcc10                               2.10GB/s ± 0%  11.23GB/s ± 0%  +435.56%  (p=0.008 n=5+5)

mimic_crc32_ieee_10k                                       774MB/s ± 0%    776MB/s ± 0%    +0.23%  (p=0.016 n=5+5)
mimic_crc32_ieee_100k                                      773MB/s ± 0%    775MB/s ± 0%    +0.24%  (p=0.032 n=5+5)

wuffs_gzip_decode_10k/clang9                               151MB/s ± 0%    166MB/s ± 0%    +9.81%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang9                              155MB/s ± 0%    178MB/s ± 0%   +14.53%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/gcc10                                150MB/s ± 0%    172MB/s ± 0%   +14.92%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc10                               188MB/s ± 0%    198MB/s ± 0%    +5.37%  (p=0.008 n=5+5)

mimic_gzip_decode_10k                                      121MB/s ± 0%    121MB/s ± 0%      ~     (p=1.000 n=5+5)
mimic_gzip_decode_100k                                     143MB/s ± 0%    144MB/s ± 0%      ~     (p=0.056 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang9                     111MB/s ± 0%    115MB/s ± 0%    +3.77%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9                    147MB/s ± 0%    153MB/s ± 0%    +4.66%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     404MB/s ± 0%    415MB/s ± 0%    +2.75%  (p=0.016 n=5+4)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   344MB/s ± 0%    345MB/s ± 1%      ~     (p=0.151 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   329MB/s ± 0%    335MB/s ± 0%    +1.78%  (p=0.016 n=5+4)
wuffs_png_decode_image_4002k_24bpp/clang9                  148MB/s ± 0%    153MB/s ± 0%    +3.38%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/gcc10                      120MB/s ± 0%    123MB/s ± 0%    +2.62%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc10                     153MB/s ± 0%    159MB/s ± 1%    +3.54%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc10                      440MB/s ± 0%    452MB/s ± 0%    +2.82%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    357MB/s ± 0%    353MB/s ± 0%    -0.95%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    341MB/s ± 0%    341MB/s ± 0%      ~     (p=0.151 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc10                   157MB/s ± 0%    161MB/s ± 0%    +2.85%  (p=0.016 n=5+4)

mimic_png_decode_image_19k_8bpp                           58.1MB/s ± 0%   58.1MB/s ± 0%      ~     (p=0.389 n=5+5)
mimic_png_decode_image_40k_24bpp                          73.2MB/s ± 0%   73.2MB/s ± 0%      ~     (p=0.548 n=5+5)
mimic_png_decode_image_77k_8bpp                            177MB/s ± 0%    177MB/s ± 0%    +0.14%  (p=0.008 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          146MB/s ± 0%    147MB/s ± 0%    +0.13%  (p=0.016 n=5+5)
mimic_png_decode_image_4002k_24bpp                         104MB/s ± 0%    104MB/s ± 0%      ~     (p=0.556 n=5+4)
2021-03-07 12:27:45 +11:00
Nigel Tao 44acd0e20a Add std/crc32 ieee_hasher.up_x86_sse42 placeholder 2021-03-06 11:20:50 +11:00
Nigel Tao 21cc4fa8ba Use more arm_neon_uAxB types and methods 2021-02-24 22:22:30 +11:00
Nigel Tao 3b5d8fdfba Use arm_neon_uAxB types and methods 2021-02-24 16:48:09 +11:00
Nigel Tao 62ee403d06 Add arm_neon u8x8, u16x4, etc types 2021-02-24 14:28:45 +11:00
Nigel Tao fa774e647f Add x86_sse42_utility.make_m128i_slice128 2021-02-18 22:32:21 +11:00
Nigel Tao d4c23d091a Add base.x86_sse42_utility.make_m128i_single_u32 2021-02-18 20:30:59 +11:00
Nigel Tao 8c8f534a5c Add base.x86_sse42_utility 2021-02-18 20:02:58 +11:00
Nigel Tao 869be76fae Rename some std/png c/p variables 2021-02-18 14:32:35 +11:00
Nigel Tao 8c4348b8f6 Rename some std etc_sse42 functions 2021-02-18 13:48:46 +11:00
Nigel Tao 02e0955897 Rename std/png/decode_filter_sse42.wuffs 2021-02-18 13:40:40 +11:00
Nigel Tao 26c7fb941f Un-choosy-fy std/png decoder.filter_2 2021-02-18 13:32:25 +11:00
Nigel Tao 4d2df86a6d Fix some -Werror=conversion false positives 2021-02-16 22:45:50 +11:00
Nigel Tao b77137686d Remove redundant arm_neon zero-initialization 2021-02-16 22:32:06 +11:00
Nigel Tao 9c1af68889 Factor out std/crc32/common_up_arm_crc32.wuffs 2021-02-16 22:27:33 +11:00
Nigel Tao 4c3f8ccfff Factor out std/adler32/common_up_x86_sse42.wuffs 2021-02-16 22:23:54 +11:00
Nigel Tao 010b34ed38 Add std/adler32 hasher.up_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_adler32_10k/clang9                                  1.21GB/s ± 0%   6.58GB/s ± 1%  +442.43%  (p=0.008 n=5+5)
wuffs_adler32_100k/clang9                                 1.20GB/s ± 0%   6.58GB/s ± 0%  +449.37%  (p=0.008 n=5+5)

wuffs_adler32_10k/gcc8                                    1.24GB/s ± 0%   4.31GB/s ± 0%  +248.87%  (p=0.008 n=5+5)
wuffs_adler32_100k/gcc8                                   1.22GB/s ± 0%   4.29GB/s ± 0%  +251.09%  (p=0.008 n=5+5)

mimic_adler32_10k                                         1.40GB/s ± 0%   1.40GB/s ± 0%    -0.04%  (p=0.008 n=5+5)
mimic_adler32_100k                                        1.35GB/s ± 0%   1.38GB/s ± 0%    +2.77%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/clang9                              85.3MB/s ± 0%   91.1MB/s ± 0%    +6.83%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/clang9                              107MB/s ± 0%    113MB/s ± 0%    +5.20%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc8                                86.1MB/s ± 0%   91.0MB/s ± 0%    +5.69%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc8                                104MB/s ± 0%    111MB/s ± 0%    +7.08%  (p=0.016 n=5+4)

mimic_zlib_decode_10k                                      108MB/s ± 0%    108MB/s ± 0%      ~     (p=0.548 n=5+5)
mimic_zlib_decode_100k                                     142MB/s ± 0%    141MB/s ± 1%      ~     (p=0.310 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang9                    69.9MB/s ± 0%   74.3MB/s ± 0%    +6.37%  (p=0.016 n=5+4)
wuffs_png_decode_image_40k_24bpp/clang9                   99.4MB/s ± 0%  104.3MB/s ± 0%    +4.92%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     266MB/s ± 0%    280MB/s ± 0%    +5.21%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   165MB/s ± 0%    169MB/s ± 0%    +2.45%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   146MB/s ± 0%    163MB/s ± 0%   +11.86%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                 93.2MB/s ± 0%   97.7MB/s ± 0%    +4.78%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/gcc8                      70.3MB/s ± 0%   74.3MB/s ± 0%    +5.70%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc8                      101MB/s ± 0%    107MB/s ± 0%    +5.67%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc8                       247MB/s ± 0%    259MB/s ± 0%    +4.71%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc8     162MB/s ± 0%    162MB/s ± 0%    +0.09%  (p=0.032 n=5+4)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc8     140MB/s ± 0%    155MB/s ± 0%   +10.67%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc8                   94.1MB/s ± 0%   99.4MB/s ± 0%    +5.57%  (p=0.008 n=5+5)

mimic_png_decode_image_19k_8bpp                           43.6MB/s ± 0%   43.3MB/s ± 1%      ~     (p=0.167 n=5+5)
mimic_png_decode_image_40k_24bpp                          54.6MB/s ± 0%   54.6MB/s ± 0%      ~     (p=1.000 n=5+5)
mimic_png_decode_image_77k_8bpp                            125MB/s ± 0%    123MB/s ± 0%    -1.03%  (p=0.016 n=5+4)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          102MB/s ± 0%    101MB/s ± 0%    -0.43%  (p=0.008 n=5+5)
mimic_png_decode_image_4002k_24bpp                        81.3MB/s ± 0%   81.8MB/s ± 0%    +0.62%  (p=0.008 n=5+5)
2021-02-16 22:17:46 +11:00
Nigel Tao d13039d96e Add std/png decoder.filter_4_distance_?_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_png_decode_filt_4_dist_3/clang9                      180MB/s ± 0%    217MB/s ± 0%   +20.57%  (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_4/clang9                      161MB/s ± 0%    287MB/s ± 0%   +78.75%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9                   99.1MB/s ± 0%   99.4MB/s ± 0%    +0.27%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   123MB/s ± 0%    165MB/s ± 0%   +33.61%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   112MB/s ± 0%    146MB/s ± 0%   +29.64%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                 93.1MB/s ± 0%   93.2MB/s ± 0%    +0.15%  (p=0.040 n=5+5)

wuffs_png_decode_filt_4_dist_3/gcc8                       80.5MB/s ± 0%  211.7MB/s ± 0%  +163.12%  (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_4/gcc8                       77.3MB/s ± 0%  280.4MB/s ± 0%  +262.98%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc8                     98.1MB/s ± 0%  100.8MB/s ± 0%    +2.78%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc8     114MB/s ± 0%    162MB/s ± 0%   +41.95%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc8     103MB/s ± 0%    140MB/s ± 0%   +36.07%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc8                   93.2MB/s ± 0%   94.1MB/s ± 0%    +0.96%  (p=0.008 n=5+5)
2021-02-14 23:53:36 +11:00
Nigel Tao 41825fcaae Add std/png decoder.filter_3_distance_4_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_png_decode_filt_3_dist_4/clang9                      639MB/s ± 0%   906MB/s ± 0%  +41.71%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_4/gcc8                        656MB/s ± 0%   714MB/s ± 0%   +8.89%  (p=0.008 n=5+5)
2021-02-14 22:12:48 +11:00
Nigel Tao 435330494e Add std/png decoder.filter_1_distance_4_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_png_decode_filt_1_dist_4/clang9                     1.09GB/s ± 1%  1.42GB/s ± 0%  +30.50%  (p=0.008 n=5+5)
wuffs_png_decode_filt_1_dist_4/gcc8                        859MB/s ± 0%   891MB/s ± 0%   +3.66%  (p=0.008 n=5+5)
2021-02-14 21:43:56 +11:00
Nigel Tao 84f3592dbe Add base.arm_crc32_u32 type
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_crc32_ieee_10k/clang9                                825MB/s ± 0%  6802MB/s ± 0%  +724.00%  (p=0.008 n=5+5)
wuffs_crc32_ieee_100k/clang9                               837MB/s ± 0%  6199MB/s ± 0%  +640.25%  (p=0.008 n=5+5)

wuffs_crc32_ieee_10k/gcc8                                  960MB/s ± 0%  4495MB/s ± 0%  +368.35%  (p=0.016 n=4+5)
wuffs_crc32_ieee_100k/gcc8                                 961MB/s ± 0%  4447MB/s ± 0%  +363.01%  (p=0.016 n=5+4)

mimic_crc32_ieee_10k                                       638MB/s ± 0%   631MB/s ± 0%    -1.17%  (p=0.008 n=5+5)
mimic_crc32_ieee_100k                                      639MB/s ± 0%   639MB/s ± 0%    +0.02%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/clang9                              83.0MB/s ± 0%  90.7MB/s ± 0%    +9.26%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang9                              100MB/s ± 0%   112MB/s ± 0%   +11.91%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/gcc8                                86.1MB/s ± 0%  91.9MB/s ± 0%    +6.72%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc8                                102MB/s ± 0%   112MB/s ± 0%    +9.34%  (p=0.008 n=5+5)

mimic_gzip_decode_10k                                     98.8MB/s ± 0%  98.2MB/s ± 0%    -0.60%  (p=0.008 n=5+5)
mimic_gzip_decode_100k                                     128MB/s ± 0%   128MB/s ± 0%    -0.08%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang9                    67.6MB/s ± 0%  70.8MB/s ± 0%    +4.72%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9                   92.8MB/s ± 0%  98.8MB/s ± 0%    +6.49%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     255MB/s ± 0%   269MB/s ± 0%    +5.44%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   123MB/s ± 0%   123MB/s ± 0%    +0.13%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   110MB/s ± 0%   112MB/s ± 0%    +1.46%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                 88.4MB/s ± 0%  92.8MB/s ± 0%    +4.90%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/gcc8                      67.2MB/s ± 0%  70.8MB/s ± 0%    +5.37%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc8                     94.0MB/s ± 0%  98.2MB/s ± 0%    +4.45%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc8                       236MB/s ± 0%   248MB/s ± 0%    +4.84%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc8     114MB/s ± 0%   115MB/s ± 0%    +1.11%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc8     102MB/s ± 0%   104MB/s ± 0%    +2.17%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc8                   88.8MB/s ± 0%  94.3MB/s ± 0%    +6.21%  (p=0.008 n=5+5)

mimic_png_decode_image_19k_8bpp                           43.7MB/s ± 1%  43.4MB/s ± 1%      ~     (p=0.095 n=5+5)
mimic_png_decode_image_40k_24bpp                          54.6MB/s ± 0%  53.9MB/s ± 0%    -1.25%  (p=0.008 n=5+5)
mimic_png_decode_image_77k_8bpp                            125MB/s ± 0%   124MB/s ± 0%    -0.73%  (p=0.008 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          102MB/s ± 0%   101MB/s ± 0%    -0.95%  (p=0.008 n=5+5)
mimic_png_decode_image_4002k_24bpp                        81.3MB/s ± 0%  81.0MB/s ± 0%    -0.46%  (p=0.016 n=4+5)
2021-02-13 22:54:47 +11:00
Nigel Tao 81ba41e251 Add slice uintptr_low_12_bits method 2021-02-13 17:19:35 +11:00
Nigel Tao 0834b40d22 Add std/crc32 ieee_hasher.up_arm_crc32 2021-02-13 17:02:02 +11:00
Nigel Tao 8595a3b696 Add std/deflate decode_huffman_fast32
This undoes commit 1a63b53e "Have std/deflate read 64 bits once per
inner loop" for 32-bit CPUs.

On a Raspberry Pi 4 (32-bit armv7l):

wuffs_deflate_decode_1k_full_init/clang9         44.9MB/s ± 1%   50.1MB/s ± 1%  +11.54%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/clang9         52.8MB/s ± 0%   61.1MB/s ± 0%  +15.61%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang9        81.4MB/s ± 0%   84.5MB/s ± 0%   +3.89%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang9        87.9MB/s ± 0%   91.1MB/s ± 0%   +3.67%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang9    106MB/s ± 0%    113MB/s ± 0%   +5.70%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang9  59.6MB/s ± 0%   59.1MB/s ± 0%   -0.81%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k_full_init/gcc8           44.7MB/s ± 1%   50.9MB/s ± 1%  +13.91%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/gcc8           52.6MB/s ± 0%   61.5MB/s ± 0%  +17.06%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc8          76.5MB/s ± 0%   85.6MB/s ± 1%  +11.89%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc8          82.3MB/s ± 0%   92.2MB/s ± 0%  +12.07%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc8     97.8MB/s ± 0%  112.1MB/s ± 0%  +14.62%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc8    58.0MB/s ± 0%   61.6MB/s ± 0%   +6.09%  (p=0.008 n=5+5)
2021-02-08 23:19:00 +11:00
Nigel Tao 279d69bb38 Prepare to add std/deflate decode_huffman_fast32 2021-02-08 22:51:57 +11:00
Nigel Tao 4993f88a66 Add base.utility.cpu_arch_is_32_bit() 2021-02-08 22:45:51 +11:00
Nigel Tao 39e2044102 Rename std/deflate decode_huffman_fast function 2021-02-08 22:34:28 +11:00
Nigel Tao 97591ee3c9 Rename std/deflate/decode_huffman_fast.wuffs 2021-02-08 22:30:29 +11:00
Nigel Tao 77d5fa01e5 Have std/png decode 16-bit depth images 2021-02-06 23:41:37 +11:00
Nigel Tao d8d951b729 Remove std/png tricky field 2021-02-05 23:06:49 +11:00
Nigel Tao 0a1b8ddf78 Factor out std/png/decode_swizzle_fallback.wuffs 2021-02-05 22:59:26 +11:00
Nigel Tao f1a8019f41 Drop std/png filter_and_swizzle_low_bit_depth 2021-02-05 22:56:55 +11:00
Nigel Tao baad01d50f Have std/png decode interlaced PNG images 2021-02-05 22:53:05 +11:00
Nigel Tao 4053c2abe6 Refactor some std/png internals 2021-02-03 22:08:26 +11:00
Nigel Tao 4942324f25 Swizzler support src_pixfmt = PIXEL_FORMAT__Y_16BE
Binary size, before:
30800 gen/lib/c/clang-9-dynamic/wuffs-base-pixconv.lo
32424 gen/lib/c/clang-9-static/wuffs-base-pixconv.o
56200 gen/lib/c/gcc-dynamic/wuffs-base-pixconv.lo
56152 gen/lib/c/gcc-static/wuffs-base-pixconv.o

After:
33416 gen/lib/c/clang-9-dynamic/wuffs-base-pixconv.lo
35120 gen/lib/c/clang-9-static/wuffs-base-pixconv.o
59504 gen/lib/c/gcc-dynamic/wuffs-base-pixconv.lo
59440 gen/lib/c/gcc-static/wuffs-base-pixconv.o
2021-02-03 13:11:22 +11:00
Nigel Tao e77e16cd98 Add fact for "lhs = x[i .. j]" for constant i, j 2021-02-02 22:53:02 +11:00
Nigel Tao 10146b75dd Drop old facts after an impure function call 2021-02-02 22:11:45 +11:00
Nigel Tao 4848859f97 Tweak std/deflate decode_huffman_fast asserts
wuffs_deflate_decode_1k_full_init/clang9         95.0MB/s ± 0%  92.9MB/s ± 0%   -2.25%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/clang9          108MB/s ± 0%   108MB/s ± 0%   +0.34%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang9         141MB/s ± 0%   165MB/s ± 1%  +16.77%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang9         143MB/s ± 0%   169MB/s ± 0%  +17.73%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang9    185MB/s ± 0%   181MB/s ± 0%   -2.09%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang9   156MB/s ± 1%   151MB/s ± 0%   -3.12%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k_full_init/gcc10          98.6MB/s ± 0%  97.5MB/s ± 0%   -1.05%  (p=0.016 n=4+5)
wuffs_deflate_decode_1k_part_init/gcc10           112MB/s ± 0%   111MB/s ± 0%   -1.05%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc10          183MB/s ± 0%   181MB/s ± 1%   -0.73%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc10          186MB/s ± 0%   185MB/s ± 0%   -0.80%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc10     213MB/s ± 0%   216MB/s ± 0%   +1.55%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc10    174MB/s ± 0%   179MB/s ± 0%   +2.79%  (p=0.008 n=5+5)
2021-02-02 13:08:21 +11:00
Nigel Tao f1a27fd980 Tweak std/png's swizzle_low_bit_depth scratch use 2021-02-01 22:48:01 +11:00
Nigel Tao 4d8e179279 Have std/png process the tRNS chunk 2021-02-01 21:34:28 +11:00
Nigel Tao a4d818699a Have std/png support low bit depths 2021-01-29 22:44:27 +11:00
Nigel Tao 8c4c714ad1 Add 0b prefixed binary numbers 2021-01-28 21:54:06 +11:00
Nigel Tao 1a63b53e13 Have std/deflate read 64 bits once per inner loop
On a mid-range x86_64 laptop:

wuffs_deflate_decode_1k_full_init/clang9                   101MB/s ± 0%     92MB/s ± 2%   -9.22%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/clang9                   117MB/s ± 0%    107MB/s ± 3%   -8.00%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang9                  129MB/s ± 0%    140MB/s ± 1%   +8.36%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang9                  131MB/s ± 0%    142MB/s ± 1%   +8.59%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang9             158MB/s ± 0%    184MB/s ± 1%  +16.29%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang9            133MB/s ± 0%    155MB/s ± 1%  +16.26%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k_full_init/gcc10                   98.0MB/s ± 0%   97.7MB/s ± 0%     ~     (p=0.222 n=5+5)
wuffs_deflate_decode_1k_part_init/gcc10                    112MB/s ± 0%    111MB/s ± 0%   -1.04%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc10                   138MB/s ± 0%    179MB/s ± 1%  +29.91%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc10                   140MB/s ± 0%    183MB/s ± 1%  +30.52%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc10              188MB/s ± 0%    211MB/s ± 1%  +12.32%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc10             156MB/s ± 0%    172MB/s ± 1%  +10.00%  (p=0.008 n=5+5)

mimic_deflate_decode_1k                                    128MB/s ± 0%    127MB/s ± 1%   -0.99%  (p=0.016 n=5+5)
mimic_deflate_decode_10k                                   143MB/s ± 0%    142MB/s ± 1%     ~     (p=0.056 n=5+5)
mimic_deflate_decode_100k_just_one_read                    176MB/s ± 0%    174MB/s ± 1%     ~     (p=0.151 n=5+5)
mimic_deflate_decode_100k_many_big_reads                   135MB/s ± 0%    134MB/s ± 1%     ~     (p=0.151 n=5+5)

wuffs_gzip_decode_10k/clang9                               134MB/s ± 1%    127MB/s ± 0%   -5.23%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang9                              150MB/s ± 0%    162MB/s ± 0%   +8.23%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/gcc10                                131MB/s ± 0%    152MB/s ± 0%  +16.36%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc10                               159MB/s ± 2%    188MB/s ± 0%  +17.78%  (p=0.008 n=5+5)

mimic_gzip_decode_10k                                      121MB/s ± 0%    121MB/s ± 0%     ~     (p=0.841 n=5+5)
mimic_gzip_decode_100k                                     144MB/s ± 0%    143MB/s ± 0%   -0.11%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/clang9                               139MB/s ± 0%    135MB/s ± 0%   -2.36%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/clang9                              155MB/s ± 0%    176MB/s ± 0%  +13.83%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc10                                141MB/s ± 0%    156MB/s ± 1%  +10.94%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc10                               172MB/s ± 0%    193MB/s ± 1%  +12.27%  (p=0.016 n=4+5)

mimic_zlib_decode_10k                                      133MB/s ± 0%    132MB/s ± 0%   -1.29%  (p=0.008 n=5+5)
mimic_zlib_decode_100k                                     160MB/s ± 0%    158MB/s ± 0%   -1.02%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang9                    94.7MB/s ± 0%  103.4MB/s ± 0%   +9.17%  (p=0.016 n=4+5)
wuffs_png_decode_image_40k_24bpp/clang9                    135MB/s ± 0%    146MB/s ± 0%   +8.03%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     351MB/s ± 0%    380MB/s ± 0%   +8.48%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   320MB/s ± 1%    343MB/s ± 0%   +7.20%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   308MB/s ± 0%    328MB/s ± 0%   +6.59%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                  138MB/s ± 0%    149MB/s ± 0%   +8.02%  (p=0.016 n=5+4)

wuffs_png_decode_image_19k_8bpp/gcc10                      101MB/s ± 1%    116MB/s ± 0%  +14.61%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc10                     136MB/s ± 0%    154MB/s ± 0%  +13.10%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc10                      371MB/s ± 0%    426MB/s ± 0%  +14.80%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    333MB/s ± 0%    357MB/s ± 0%   +7.31%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    318MB/s ± 0%    341MB/s ± 0%   +7.27%  (p=0.016 n=5+4)
wuffs_png_decode_image_4002k_24bpp/gcc10                   138MB/s ± 0%    157MB/s ± 0%  +13.59%  (p=0.008 n=5+5)

mimic_png_decode_image_19k_8bpp                           58.2MB/s ± 0%   58.1MB/s ± 0%     ~     (p=0.841 n=5+5)
mimic_png_decode_image_40k_24bpp                          73.3MB/s ± 0%   73.2MB/s ± 0%   -0.16%  (p=0.032 n=5+5)
mimic_png_decode_image_77k_8bpp                            177MB/s ± 0%    177MB/s ± 0%     ~     (p=0.690 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          146MB/s ± 0%    146MB/s ± 0%     ~     (p=0.690 n=5+5)
mimic_png_decode_image_4002k_24bpp                         104MB/s ± 0%    104MB/s ± 0%     ~     (p=0.841 n=5+5)
2021-01-28 09:34:37 +11:00
Nigel Tao b61a827354 Optimize std/adler32 for SSE4.2
On a mid-range x86_64 laptop:

wuffs_adler32_10k/clang9                                  1.35GB/s ± 0%  10.78GB/s ± 1%  +700.65%  (p=0.008 n=5+5)
wuffs_adler32_100k/clang9                                 1.35GB/s ± 0%  12.88GB/s ± 0%  +856.09%  (p=0.008 n=5+5)

wuffs_adler32_10k/gcc10                                   1.85GB/s ± 0%  11.21GB/s ± 0%  +506.34%  (p=0.008 n=5+5)
wuffs_adler32_100k/gcc10                                  1.84GB/s ± 0%  11.43GB/s ± 0%  +521.51%  (p=0.008 n=5+5)

mimic_adler32_10k                                         1.76GB/s ± 0%   1.76GB/s ± 0%      ~     (p=0.841 n=5+5)
mimic_adler32_100k                                        1.72GB/s ± 0%   1.72GB/s ± 0%      ~     (p=0.222 n=5+5)

wuffs_zlib_decode_10k/clang9                               124MB/s ± 0%    139MB/s ± 0%   +12.29%  (p=0.016 n=4+5)
wuffs_zlib_decode_100k/clang9                              148MB/s ± 0%    155MB/s ± 0%    +4.21%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc10                                133MB/s ± 1%    141MB/s ± 0%    +5.75%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc10                               159MB/s ± 0%    172MB/s ± 0%    +7.77%  (p=0.016 n=5+4)

mimic_zlib_decode_10k                                      133MB/s ± 0%    133MB/s ± 0%    +0.38%  (p=0.008 n=5+5)
mimic_zlib_decode_100k                                     160MB/s ± 0%    160MB/s ± 0%      ~     (p=0.841 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang9                    90.6MB/s ± 0%   94.7MB/s ± 0%    +4.58%  (p=0.016 n=5+4)
wuffs_png_decode_image_40k_24bpp/clang9                    129MB/s ± 0%    135MB/s ± 0%    +4.49%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     335MB/s ± 0%    351MB/s ± 0%    +4.62%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   322MB/s ± 0%    320MB/s ± 1%    -0.71%  (p=0.016 n=4+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   256MB/s ± 0%    308MB/s ± 0%   +20.24%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                  131MB/s ± 0%    138MB/s ± 0%    +5.24%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/gcc10                     95.1MB/s ± 0%  100.8MB/s ± 1%    +6.08%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc10                     131MB/s ± 0%    136MB/s ± 0%    +3.65%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc10                      350MB/s ± 1%    371MB/s ± 0%    +6.06%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    327MB/s ± 0%    333MB/s ± 0%    +1.66%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    274MB/s ± 0%    318MB/s ± 0%   +15.93%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc10                   132MB/s ± 0%    138MB/s ± 0%    +4.73%  (p=0.008 n=5+5)

mimic_png_decode_image_19k_8bpp                           58.1MB/s ± 0%   58.2MB/s ± 0%    +0.27%  (p=0.008 n=5+5)
mimic_png_decode_image_40k_24bpp                          73.0MB/s ± 1%   73.3MB/s ± 0%    +0.45%  (p=0.008 n=5+5)
mimic_png_decode_image_77k_8bpp                            177MB/s ± 0%    177MB/s ± 0%      ~     (p=0.421 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          146MB/s ± 0%    146MB/s ± 0%      ~     (p=0.310 n=5+5)
mimic_png_decode_image_4002k_24bpp                         104MB/s ± 0%    104MB/s ± 0%      ~     (p=0.056 n=5+5)
2021-01-26 22:31:54 +11:00