Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 64 Bitties

Author: Robert Hyatt

Date: 12:28:04 01/04/00

Go up one level in this thread


On January 04, 2000 at 12:11:38, Poschmann wrote:

>
>Can you explain your example ? If I have to realize your example I could do it
>in the following two ways:
>
>//1.
>if(pos(pawn1)==this_square){
>  if(pos(pawn2)==that_square)
>    action11;
>  else
>    action12;
>}
>else{
>  if(pos(pawn2)==that_square)
>    action21;
>  else
>    action22;
>}
>

run that thru your compiler and look at all them branches.  branches are
evil on super-scalar machines and really hurt performance.



>//2.
>idx=(BitBoard_Position_of_Pawns&Mask_Pawn12)<<Some_Bits;
>switch(idx)
>{
>  case 0: action22;
>          break;
>  case 1: action21;
>          break;
>  case 8: action12;
>          break;
>  case 9: action11;
>          break;
>}

that is just as bad.  lots of branches, with nothing in between them.  just
pipeline restart after pipeline restart.




>
>In both cases the program not realy benefit from a larger integer word. Because
>the decision-tree is sequential as before. Am I wrong ?
>In the second case you can exchange the switch statement for a lookup table
>access. But the number of table entries is limited by the available memory.


To ask if a white pawn on d5 is passed, I do this:

if (is_passed_white[d5] & BlackPawns) {do this if it is passed}

that takes one AND operation on a 64 bit machine, two on a 32 bit
machine.



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.