Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Mixing 0x88 and bitboards

Author: Dieter Buerssner

Date: 14:29:59 06/25/02

Go up one level in this thread


On June 25, 2002 at 17:21:09, Gian-Carlo Pascutto wrote:

>On June 25, 2002 at 17:09:42, Dieter Buerssner wrote:
>
>>An intelligent compiler could produce better code with something like
                          ^^^^^
>>
>>if (WhitePawns & (1ULL << E6))
>>
>>1 32-bit load,
>>1 32-bit and, branch based on the flags.
>>
>>Of course, this optimization cannot work anymore, when E6 is "sq".
>
>The load and and are 64-bit operations in the
>example above. But, you could do it with 32-bits
>via the trick you described earlier. (We already
>know what half of the board we are interested in)

1ULL << E6 is a compile time constant. The compiler can know, that only in one
of the 2 32 bit words, bits are set. It also can know, that anything & 0 is 0,
so it can optimize the other half away. I am too lazy to check now, but I think,
I have seen this optimization.

Regards,
Dieter




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.