This recreates the case as of commit f1698226 (tag v0.4.0-alpha.4), in
that, by default (without #define'ing a macro or passing an /arch:ETC
compiler flag), Wuffs does not use SIMD on MSVC x86_64.
Commit b64a7610 (after tag v0.4.0-alpha.4, before tag v0.4.0-alpha.5)
changed the default so that x86_64_v2 (roughly equivalent to SSE4.2) was
enabled by default, since the user from issue #148 was enabling that
anyway (in an unsupported way, by #define'ing a macro that was a private
implementation detail) with no problems (and better performance).
However, another user later reported (in issue #151) that enabling SIMD
on MSVC x86_64 somehow lead to ICEs (Internal Compiler Errors).
This commit restores the default to "no SIMD" and it is up to the MSVC
user to opt in to the SIMD code paths. Clang and GCC are unaffected:
SIMD remains enabled by default.
Updates #148
Updates #151
If I understand the https://github.com/google/wuffs/issues/148
discussion correctly, a user overrode WUFFS_BASE__CPU_ARCH__X86_FAMILY
(without also providing /arch:AVX) to enable SSE4.2 code (even though,
technically, x86_64 doesn't guarantee SSE4.2, only SSE2). This seemed to
work fine in practice, but was unsupported by Wuffs and 'broke' by
fixing #145, now looking for WUFFS_BASE__CPU_ARCH__X86_64 instead of
WUFFS_BASE__CPU_ARCH__X86_FAMILY.
WUFFS_BASE__CPU_ARCH__X86_FAMILY has since been renamed to
WUFFS_PRIVATE_IMPL__CPU_ARCH__X86_FAMILY and then removed entirely.
As SSE4.2 (roughly equivalent to x86-64-v2) seems to work fine at
compile time (with the existing cpuid detection at runtime), enable it
by default for MSVC, without need /arch.
Enabling x86-64-v3 too, by default, is held back for now, pending
further confirmation from MSVC users. The #148 user was exercising
Wuffs' PNG codec, which uses SSE4.2 but not AVX or AVX2. Currently, only
Wuffs' JPEG codec (and YCbCr conversion) uses AVX or AVX2.
GCC and Clang don't need this fiddliness, because they support
"__attribute__((target(arg)))".
Updates #148
PNG (as a source pixel format) is RGB or RGBA order. Wuffs' std/png
benchmarks, like the other image formats, decode to BGRA order. *If*
those benchmarks are altered to target RGBA instead, we get:
name old speed new speed delta
wuffs_png_decode_image_40k_24bpp/clang14 279MB/s ± 0% 293MB/s ± 0% +5.11% (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang14 289MB/s ± 0% 303MB/s ± 0% +4.89% (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc12 311MB/s ± 0% 332MB/s ± 0% +6.84% (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc12 325MB/s ± 0% 339MB/s ± 0% +4.49% (p=0.008 n=5+5)
When starting from 3-channel RGB, ending with RGBA is now as fast as
ending with BGRA.
Updates #141
It was renamed to dst_history_retain_length.
It also was removed from image_decoders and token_decoders. It only
applies to io_transformers, as retaining history applies to the
destination (not source) IO buffer.
Also adjust example/bzcat and example/zcat to apply the history retain
length to the dst (not src) buffer.