Skip to content

Commit

Permalink
little optim in correctedMove2ToKingDest
Browse files Browse the repository at this point in the history
  • Loading branch information
tryingsomestuff committed Dec 8, 2022
1 parent 059657c commit 5e11286
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Source/definition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,14 @@ constexpr ScoreType badCapLimit = -80;

[[nodiscard]] FORCE_FINLINE Square correctedMove2ToKingDest(const Move m) {
assert(isValidMove(m));
return (!isCastling(m)) ? Move2To(m) : correctedKingDestSq[Move2Type(m)];
const MType mtype = Move2Type(m);
return (!isCastling(mtype)) ? Move2To(m) : correctedKingDestSq[mtype];
}

[[nodiscard]] FORCE_FINLINE Square correctedMove2ToRookDest(const Move m) {
assert(isValidMove(m));
return (!isCastling(m)) ? Move2To(m) : correctedRookDestSq[Move2Type(m)];
const MType mtype = Move2Type(m);
return (!isCastling(mtype)) ? Move2To(m) : correctedRookDestSq[mtype];
}

namespace MoveDifficultyUtil {
Expand Down
10 changes: 7 additions & 3 deletions Tools/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ WARN="-Wall -Wcast-qual -Wno-char-subscripts -Wno-reorder -Wmaybe-uninitialized

if [ ! -n "$DEBUGMINIC" ]; then
echo "******* RELEASE BUILD *******"
OPT="-s -DNDEBUG -fno-math-errno -O3 $n" ; DEPTH=16
# for VTUNE and other analyzer
#OPT="-DNDEBUG -fno-math-errno -O3 $n -g" ; DEPTH=16
if [ -n "$VTUNEMINIC" ]; then
echo "***** with VTUNE params *****"
# for VTUNE and other analyzer
OPT="-DNDEBUG -fno-math-errno -O3 $n -g" ; DEPTH=16
else
OPT="-s -DNDEBUG -fno-math-errno -O3 $n" ; DEPTH=16
fi
else
echo "******* DEBUG BUILD *******"
#OPT="-s -ffunction-sections -fdata-sections -Os -s -DNDEBUG -Wl,--gc-sections" ; DEPTH=16
Expand Down

0 comments on commit 5e11286

Please sign in to comment.