1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Allow compilation on Raspi (for ARMv8)

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
This commit is contained in:
Matthies 2023-08-16 11:11:27 +02:00 committed by Stéphane Nicolet
parent a9a0dbbcd0
commit 9abef246a9

View 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))