compiling BLAKE3 AVX/SSE optimizations on MSVC?
[email protected] (Hans Henrik Bergan) Wed, 21 Oct 2020 18:31:31 +0200
| Newsgroups | php.windows |
|---|---|
| Message-ID | <CAJmy8YFR6UUuZfosHDj3qZKjLyKT1o7XkSo+yzR0ZwzLjr87Fw@mail.gmail.com> |
i'm trying to get BLAKE3 support in PHP,
the current PR is here https://github.com/php/php-src/pull/6358
on gcc i've managed to compile in AVX512/AVX2/SSE4.1/SSE2 -optimized
versions when compiling for x86_64,
but on MSVC i was just barely able get it to compile using a generic
portable C implementation,
if someone could help getting the AVX/SSE versions to compile in MSVC,
that'd be neat
(i don't even have a MSVC system to play with, so i don't want to
figure that out myself - also it's not actually important, it's just a
performance thing, it will work even with just the generic portable C
implementation)
specifically, when compiling for x86_64 on MSVC, the following files
should be compiled in as well:
ext/hash/blake3/blake3_avx512_x86-64_windows_msvc.asm
ext/hash/blake3/blake3_avx2_x86-64_windows_msvc.asm
ext/hash/blake3/blake3_sse41_x86-64_windows_msvc.asm
ext/hash/blake3/blake3_sse2_x86-64_windows_msvc.asm
and in ext/hash/config.w32
these should not apply to x86_64:
ADD_FLAG('CFLAGS_HASH', (...)+
'/DBLAKE3_NO_SSE2 /DBLAKE3_NO_SSE41 /DBLAKE3_NO_AVX2 /DBLAKE3_NO_AVX512');
- those were just added in a "desperate" (but successful) attempt at
making it compile in MSVC, by disabling all the AVX/SSE optimizations