]> git.sesse.net Git - stockfish/commitdiff
Fix for MSVC compilation.
authorAndreas Matthies <a.matthies@online.de>
Tue, 13 Jun 2023 04:24:04 +0000 (06:24 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 13 Jun 2023 06:45:25 +0000 (08:45 +0200)
MSVC needs two more explicit casts to compile new affine_transform_sparse_input.
See https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_castsi256_ps
and https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_castsi128_ps

closes https://github.com/official-stockfish/Stockfish/pull/4616

No functional change

AUTHORS
src/nnue/layers/affine_transform_sparse_input.h

diff --git a/AUTHORS b/AUTHORS
index 63b862ced052e482254f6b33e193ab2222833ef4..a89dc1304add3d93862f2bb31eef1eff962ee7af 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -19,6 +19,7 @@ Alexander Kure
 Alexander Pagel (Lolligerhans)
 Alfredo Menezes (lonfom169)
 Ali AlZhrani (Cooffe)
+Andreas Matthies (Matthies)
 Andrei Vetrov (proukornew)
 Andrew Grant (AndyGrant)
 Andrey Neporada (nepal)
index 00b17c19f129b868050492371a8752c54efdf5ce..e0c3a8a06bb5478c2f4e48d21b651a15699591a0 100644 (file)
@@ -98,10 +98,10 @@ namespace Stockfish::Eval::NNUE::Layers {
     #define vec_nnz(a) _mm512_cmpgt_epi32_mask(a, _mm512_setzero_si512())
 #elif defined (USE_AVX2)
     using vec_t = __m256i;
-    #define vec_nnz(a) _mm256_movemask_ps((__m256)_mm256_cmpgt_epi32(a, _mm256_setzero_si256()))
+    #define vec_nnz(a) _mm256_movemask_ps(_mm256_castsi256_ps(_mm256_cmpgt_epi32(a, _mm256_setzero_si256())))
 #elif defined (USE_SSSE3)
     using vec_t = __m128i;
-    #define vec_nnz(a) _mm_movemask_ps((__m128)_mm_cmpgt_epi32(a, _mm_setzero_si128()))
+    #define vec_nnz(a) _mm_movemask_ps(_mm_castsi128_ps(_mm_cmpgt_epi32(a, _mm_setzero_si128())))
 #endif
     constexpr IndexType InputSimdWidth = sizeof(vec_t) / sizeof(std::int32_t);
     // Inputs are processed InputSimdWidth at a time and outputs are processed 8 at a time so we process in chunks of max(InputSimdWidth, 8)