mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Make enums unsigned
Speed up by using unsigned enums. Passed STC: LLR: 2.98 (-2.94,2.94) <0.00,2.00> Total: 49248 W: 12894 L: 12568 D: 23786 Ptnml(0-2): 119, 5353, 13397, 5593, 16 https://tests.stockfishchess.org/tests/view/695e3e5002d0182a589fe965 closes https://github.com/official-stockfish/Stockfish/pull/6532 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
9b8c5c9f75
commit
d852a9195e
+4
-4
@@ -47,10 +47,10 @@ template<Direction offset>
|
||||
inline Move* splat_pawn_moves(Move* moveList, Bitboard to_bb) {
|
||||
alignas(64) static constexpr auto SPLAT_TABLE = [] {
|
||||
std::array<Move, 64> table{};
|
||||
for (int8_t i = 0; i < 64; i++)
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
Square from{std::clamp<int8_t>(i - offset, 0, 63)};
|
||||
table[i] = {Move(from, Square{i})};
|
||||
Square from{uint8_t(std::clamp(i - offset, 0, 63))};
|
||||
table[i] = {Move(from, Square{uint8_t(i)})};
|
||||
}
|
||||
return table;
|
||||
}();
|
||||
@@ -68,7 +68,7 @@ inline Move* splat_pawn_moves(Move* moveList, Bitboard to_bb) {
|
||||
inline Move* splat_moves(Move* moveList, Square from, Bitboard to_bb) {
|
||||
alignas(64) static constexpr auto SPLAT_TABLE = [] {
|
||||
std::array<Move, 64> table{};
|
||||
for (int8_t i = 0; i < 64; i++)
|
||||
for (uint8_t i = 0; i < 64; i++)
|
||||
table[i] = {Move(SQUARE_ZERO, Square{i})};
|
||||
return table;
|
||||
}();
|
||||
|
||||
Reference in New Issue
Block a user