Computer Chess Club Archives


Search

Terms

Messages

Subject: For compiler gurus about Bit fields

Author: Peter Fendrich

Date: 06:18:09 11/12/04


Will C++ compilers (especially .NET) handle bit fields with decent performance?
It is very tempting to use them in hash tables for instance.
Something like this:

struct Hash
{
   unsigned KeyPart    : 48;   // 32+16
   unsigned Eval       : 16;
   unsigned Flag       :  2;   // FH, FL, Inside
   unsigned FrPiece    :  4;   // Move
   unsigned Fr         :  6;   // Move
   unsigned To         :  6;   // Move
   unsigned Threat     :  1;
   unsigned Depth      : 10;
   unsigned Generation :  3;
} hash;

hash.KeyPart = HashKey;
etc...

/Peter




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.