Merge official-stockfish/master
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 9 Feb 2019 23:22:15 +0000 (00:22 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 9 Feb 2019 23:22:15 +0000 (00:22 +0100)
1  2 
src/search.cpp
src/types.h
src/uci.h
src/ucioption.cpp

diff --cc src/search.cpp
Simple merge
diff --cc src/types.h
@@@ -542,25 -433,23 +542,25 @@@ inline MoveType type_of(Move m) 
  }
  
  constexpr Square to_sq(Move m) {
 -  return Square(m & 0x3F);
 +  return Square(m & SQUARE_BIT_MASK);
  }
  
 -constexpr int from_to(Move m) {
 - return m & 0xFFF;
 +inline Square from_sq(Move m) {
 +  if (type_of(m) == DROP)
 +      return SQ_NONE;
 +  return Square((m >> SQUARE_BITS) & SQUARE_BIT_MASK);
  }
  
 -constexpr MoveType type_of(Move m) {
 -  return MoveType(m & (3 << 14));
 +inline int from_to(Move m) {
 + return to_sq(m) + (from_sq(m) << SQUARE_BITS);
  }
  
 -constexpr PieceType promotion_type(Move m) {
 -  return PieceType(((m >> 12) & 3) + KNIGHT);
 +inline PieceType promotion_type(Move m) {
 +  return type_of(m) == PROMOTION ? PieceType((m >> (2 * SQUARE_BITS + MOVE_TYPE_BITS)) & (PIECE_TYPE_NB - 1)) : NO_PIECE_TYPE;
  }
  
- inline Move make_move(Square from, Square to) {
+ constexpr Move make_move(Square from, Square to) {
 -  return Move((from << 6) + to);
 +  return Move((from << SQUARE_BITS) + to);
  }
  
  template<MoveType T>
diff --cc src/uci.h
Simple merge
Simple merge