mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-27 04:26:24 +08:00
Small cleanups (march 2021)
With help of @BM123499, @mstembera, @gvreuls, @noobpwnftw and @Fanael Thanks! Closes https://github.com/official-stockfish/Stockfish/pull/3405 No functional change
This commit is contained in:
@@ -40,7 +40,8 @@ namespace Stockfish::Eval::NNUE::Features {
|
||||
|
||||
Square ksq = orient(perspective, pos.square<KING>(perspective));
|
||||
Bitboard bb = pos.pieces() & ~pos.pieces(KING);
|
||||
while (bb) {
|
||||
while (bb)
|
||||
{
|
||||
Square s = pop_lsb(bb);
|
||||
active->push_back(make_index(perspective, s, pos.piece_on(s), ksq));
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Stockfish::Eval::NNUE::Layers {
|
||||
IndexType idx = k / 2 * kOutputDimensions * 4 + k % 2;
|
||||
sum[w[idx] < 0] += w[idx];
|
||||
}
|
||||
for (int sign : {-1, 1})
|
||||
for (int sign : { -1, 1 })
|
||||
while (sign * sum[sign == -1] > 258)
|
||||
{
|
||||
int maxK = 0, maxW = 0;
|
||||
@@ -234,9 +234,9 @@ namespace Stockfish::Eval::NNUE::Layers {
|
||||
__m128i product1 = _mm_maddubs_epi16(a1, b1);
|
||||
__m128i product2 = _mm_maddubs_epi16(a2, b2);
|
||||
__m128i product3 = _mm_maddubs_epi16(a3, b3);
|
||||
product0 = _mm_adds_epi16(product0, product1);
|
||||
product2 = _mm_adds_epi16(product2, product3);
|
||||
product0 = _mm_adds_epi16(product0, product2);
|
||||
product0 = _mm_add_epi16(product0, product1);
|
||||
product2 = _mm_add_epi16(product2, product3);
|
||||
product0 = _mm_add_epi16(product0, product2);
|
||||
product0 = _mm_madd_epi16(product0, kOnes128);
|
||||
acc = _mm_add_epi32(acc, product0);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user