]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
Fix an unfortunate bug with Visual Studio 2015
authorAdam Stylinski <kungfujesus06@gmail.com>
Mon, 3 Feb 2025 02:05:37 +0000 (21:05 -0500)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 4 Feb 2025 19:02:39 +0000 (20:02 +0100)
commit287c4dce22a3244a0e2602d9e5bf0929df74fd27
tree22ea60884a6a7e339e8deddcfd895fe751589b72
parenta3c0430afa13ef2f9002ad9f2c9dc93d9a3a469a
Fix an unfortunate bug with Visual Studio 2015

Evidently this instruction, despite the intrinsic having a register operand,
is a memory-register instruction. There seems to be no alignment requirement
for the source operand. Because of this, compilers when not optimized are doing
the unaligned load and then dumping back to the stack to do the broadcasting load.
In doing this, MSVC seems to be dumping to the stack with an aligned move at an
unaligned address, causing a segfault.  GCC does not seem to make this mistake, as
it stashes to an aligned address.

If we're on Visual Studio 2015, let's just do the longer 9 cycle sequence of a 128
bit load followed by a vinserti128. This _should_ fix this (issue #1861).
arch/x86/chunkset_avx2.c
arch/x86/chunkset_avx512.c