]> git.sesse.net Git - stockfish/commitdiff
Allow compilation on Raspi (for ARMv8)
authorMatthies <a.matthies@online.de>
Wed, 16 Aug 2023 09:11:27 +0000 (11:11 +0200)
committerStéphane Nicolet <cassio@free.fr>
Tue, 22 Aug 2023 08:43:51 +0000 (10:43 +0200)
Current master fails to compile for ARMv8 on Raspi cause gcc (version 10.2.1)
does not like to cast between signed and unsigned vector types. This patch
fixes it by using unsigned vector pointer for ARM to avoid implicite cast.

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

No functional change

src/nnue/layers/affine_transform_sparse_input.h

index 63cbaf45a3403cf2a87a1dd15ef0955d03c2515f..2cd77e49933f88fa6fa4fc245a3c8395c4e0595b 100644 (file)
@@ -72,10 +72,10 @@ namespace Stockfish::Eval::NNUE::Layers {
     #define vec128_storeu(a, b) _mm_storeu_si128(a, b)
     #define vec128_add(a, b) _mm_add_epi16(a, b)
 #elif defined (USE_NEON)
-    using vec_t = int32x4_t;
+    using vec_t = uint32x4_t;
     static const std::uint32_t Mask[4] = {1, 2, 4, 8};
     #define vec_nnz(a) vaddvq_u32(vandq_u32(vtstq_u32(a, a), vld1q_u32(Mask)))
-    using vec128_t = int16x8_t;
+    using vec128_t = uint16x8_t;
     #define vec128_zero vdupq_n_u16(0)
     #define vec128_set_16(a) vdupq_n_u16(a)
     #define vec128_load(a) vld1q_u16(reinterpret_cast<const std::uint16_t*>(a))