Micro optimize and rename move_promotion()

Rename to move_is_promotion() to be more clear, also add
a new function move_promotion_piece() to get the
promotion piece type in the few places where is needed.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-06-20 08:31:39 +01:00
parent b1e79fed99
commit 3a4d6e2034
7 changed files with 30 additions and 26 deletions

View File

@@ -78,10 +78,14 @@ inline Square move_to(Move m) {
return Square(m & 0x3F);
}
inline PieceType move_promotion(Move m) {
inline PieceType move_promotion_piece(Move m) {
return PieceType((int(m) >> 12) & 7);
}
inline int move_is_promotion(Move m) {
return m & (7 << 12);
}
inline int move_is_ep(Move m) {
return m & (1 << 15);
}