X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fvalue.h;h=fec6516a4c8c4014427afeeb3cf22d6b9941d865;hp=3d23f5054c3f71c726ca2b387a6c57ec99c99923;hb=0973cc2ef63060294f790803e0525b66ee91dfee;hpb=e05039156c61c9b36bdb34f2c163c80268f22bc7 diff --git a/src/value.h b/src/value.h index 3d23f505..fec6516a 100644 --- a/src/value.h +++ b/src/value.h @@ -52,10 +52,11 @@ enum Value { }; -/// Score struct keeps a midgame and an endgame value in a single -/// ScoreValue 64 bit union. +/// Score enum keeps a midgame and an endgame value in a single +/// integer (enum), first LSB 16 bits are used to store endgame +/// value, while upper bits are used for midgame value. -enum Score; +enum Score { ENSURE_32_BIT_SIZE = 1 << 31 }; inline Value eg_value(Score s) { return Value(int16_t(s & 0xffff)); } inline Value mg_value(Score s) { return Value((int(s) + 32768) >> 16); }