Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Pumping BitBoards

Author: Peter Fendrich

Date: 15:55:02 11/17/98

Go up one level in this thread


On November 17, 1998 at 15:11:19, Hristo wrote:

>On November 17, 1998 at 14:22:26, Peter Fendrich wrote:
>
>>In my program, Terra, I have the following union:
>>
>>typedef union BitBoardDef {
>>  unsigned __int64 i64;
>>  unsigned __int32 half[2];   // a5-h8 and a1-h4
>>} BITBOARD;
>>
>>I always use BITBOARD as parameters to funcions and I also return BITBOARD's in
>>many functions.
>>
>>Does compilers in general understand that BITBOARD really is an int64 or would
>>it be better to use pure int64 instead?
>>
>>//Peter
>
>Set your compiler to generate listing code (assembler+"c-cpp"source) and then
>just look at what is pushed on the stack, or if you are using register param.
>passing then see what registers get set before calling yourFunction(BITBOARD b).
>
>MSVC5.0-6.0 understnads the union definitions correctly. In your case it will
>treat it as __int64. I do not know how other compilers would handle this.
>
>regards.
>hristo

Yes, MSV6.0 seems to do this right but I don't know if this is stated by some
C++ spec or it's just a 'coincident' and I have no idea what other compilers
might do with this union...
//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.