Add std/adler32 hasher.up_x86_avx2

While the std/adler32 benchmarks got better, the std/zlib and std/png
benchmarks got worse.

This commit will soon be followed by a rollback, but it is committed
anyway so that we can refer to these numbers in the git log.

Binary size, before:
4056 gen/lib/c/clang-9-dynamic/wuffs-std-adler32.lo
4104 gen/lib/c/clang-9-static/wuffs-std-adler32.o
4624 gen/lib/c/gcc-dynamic/wuffs-std-adler32.lo
4680 gen/lib/c/gcc-static/wuffs-std-adler32.o

After:
4952 gen/lib/c/clang-9-dynamic/wuffs-std-adler32.lo
5016 gen/lib/c/clang-9-static/wuffs-std-adler32.o
5512 gen/lib/c/gcc-dynamic/wuffs-std-adler32.lo
5576 gen/lib/c/gcc-static/wuffs-std-adler32.o

name                                                      old speed      new speed      delta

wuffs_adler32_10k/clang9                                  11.5GB/s ± 1%  15.0GB/s ± 5%  +30.73%  (p=0.000 n=9+10)
wuffs_adler32_100k/clang9                                 13.5GB/s ± 1%  15.6GB/s ±14%  +16.06%  (p=0.001 n=9+10)

wuffs_adler32_10k/gcc10                                   11.3GB/s ± 2%  15.6GB/s ± 1%  +38.27%  (p=0.000 n=9+9)
wuffs_adler32_100k/gcc10                                  11.3GB/s ± 1%  19.4GB/s ± 1%  +71.20%  (p=0.000 n=7+9)

wuffs_zlib_decode_10k/clang9                               223MB/s ± 1%   216MB/s ± 2%   -3.45%  (p=0.000 n=10+10)
wuffs_zlib_decode_100k/clang9                              285MB/s ± 1%   284MB/s ± 1%     ~     (p=0.243 n=9+10)

wuffs_zlib_decode_10k/gcc10                                232MB/s ± 1%   216MB/s ± 1%   -6.70%  (p=0.000 n=10+9)
wuffs_zlib_decode_100k/gcc10                               291MB/s ± 1%   280MB/s ± 1%   -3.70%  (p=0.000 n=9+8)

wuffs_png_decode_image_19k_8bpp/clang9                     152MB/s ± 1%   143MB/s ± 3%   -5.89%  (p=0.000 n=8+9)
wuffs_png_decode_image_40k_24bpp/clang9                    171MB/s ± 1%   173MB/s ± 1%     ~     (p=0.094 n=9+9)
wuffs_png_decode_image_77k_8bpp/clang9                     541MB/s ± 1%   509MB/s ± 1%   -5.77%  (p=0.000 n=8+9)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   479MB/s ± 1%   464MB/s ± 3%   -3.20%  (p=0.000 n=8+10)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   461MB/s ± 1%   452MB/s ± 1%   -2.02%  (p=0.000 n=8+10)
wuffs_png_decode_image_4002k_24bpp/clang9                  177MB/s ± 1%   175MB/s ± 2%   -1.14%  (p=0.004 n=10+10)

wuffs_png_decode_image_19k_8bpp/gcc10                      159MB/s ± 1%   153MB/s ± 1%   -3.54%  (p=0.000 n=8+10)
wuffs_png_decode_image_40k_24bpp/gcc10                     188MB/s ± 1%   187MB/s ± 1%   -0.47%  (p=0.021 n=10+9)
wuffs_png_decode_image_77k_8bpp/gcc10                      557MB/s ± 0%   546MB/s ± 4%   -1.94%  (p=0.000 n=8+10)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    510MB/s ± 0%   493MB/s ± 0%   -3.33%  (p=0.000 n=10+9)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    486MB/s ± 1%   478MB/s ± 0%   -1.77%  (p=0.000 n=8+9)
wuffs_png_decode_image_4002k_24bpp/gcc10                   189MB/s ± 1%   187MB/s ± 1%   -1.26%  (p=0.000 n=10+10)
This commit is contained in:
Nigel Tao committed 2021-04-28 00:18:20 +10:00
1 parent 8ccaf81e96
commit baec831fc8
8 files changed
+367 -1

No files matched your search

+23 -1
View File
@@ -452,7 +452,8 @@ func (g *gen) writeBuiltinCPUArch(b *buffer, recv *a.Expr, method t.ID, args []*
return g.writeBuiltinCPUArchARMCRC32(b, recv, method, args, sideEffectsOnly, depth)
case id.IsBuiltInCPUArchARMNeon():
return g.writeBuiltinCPUArchARMNeon(b, recv, method, args, sideEffectsOnly, depth)
case id == t.IDX86SSE42Utility, id == t.IDX86M128I:
case id == t.IDX86SSE42Utility, id == t.IDX86M128I,
id == t.IDX86AVX2Utility, id == t.IDX86M256I:
return g.writeBuiltinCPUArchX86(b, recv, method, args, sideEffectsOnly, depth)
}
return fmt.Errorf("internal error: unsupported cpu_arch method %s.%s",
@@ -630,6 +631,27 @@ func (g *gen) writeBuiltinCPUArchX86(b *buffer, recv *a.Expr, method t.ID, args
fName, tName, ptr = "_mm_lddqu_si128", "const __m128i*)(const void*", true
case "make_m128i_zeroes":
fName, tName = "_mm_setzero_si128", ""
case "make_m256i_multiple_u8":
fName, tName = "_mm256_set_epi8", "int8_t"
case "make_m256i_multiple_u16":
fName, tName = "_mm256_set_epi16", "int16_t"
case "make_m256i_multiple_u32":
fName, tName = "_mm256_set_epi32", "int32_t"
case "make_m256i_multiple_u64":
fName, tName = "_mm256_set_epi64x", "int64_t"
case "make_m256i_repeat_u8":
fName, tName = "_mm256_set1_epi8", "int8_t"
case "make_m256i_repeat_u16":
fName, tName = "_mm256_set1_epi16", "int16_t"
case "make_m256i_repeat_u32":
fName, tName = "_mm256_set1_epi32", "int32_t"
case "make_m256i_repeat_u64":
fName, tName = "_mm256_set1_epi64x", "int64_t"
case "make_m256i_slice256":
fName, tName, ptr = "_mm256_lddqu_si256", "const __m256i*)(const void*", true
case "make_m256i_zeroes":
fName, tName = "_mm256_setzero_si256", ""
default:
return fmt.Errorf("internal error: unsupported cpu_arch method %q", methodStr)
}
+1
View File
@@ -587,6 +587,7 @@ var cTypeNames = [...]string{
t.IDARMNeonU32x4: "uint32x4_t",
t.IDARMNeonU64x2: "uint64x2_t",
t.IDX86M128I: "__m128i",
t.IDX86M256I: "__m256i",
}
const noSuchCOperator = " no_such_C_operator "