X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fvalue.h;h=fec6516a4c8c4014427afeeb3cf22d6b9941d865;hp=4f19cdaa554b64f29a2d9c820dd1e2c77012f632;hb=0973cc2ef63060294f790803e0525b66ee91dfee;hpb=12aeac5e148ff842ed80a62db6c7a6c6c99a92ed diff --git a/src/value.h b/src/value.h index 4f19cdaa..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); }