Author: scott farrell
Date: 11:37:15 11/28/03
My poor chompster is Java, and is bitboard based.
I moved to incremental attackTables, and have a attackFrom[64] and attackTo[64]
arrays of bitboards.
Actually doing them incremently didnt give much performance difference over
calculating the whole let each node - but I think my msb is so slow, everything
is slow.
I either need
- a much faster msb function, it takes about 35% of my processing time.
- a smarter way of making the attackTo array, as I am currently using msb to
iterate/popoff bits from the attackFrom bitboard, and then OR them indiviually
to the appropriate attackTo[] bitboard. Hence lots of slow msb calls.
- remove the attackTo array, and compute forward when necessary with the
attackFrom bitboards as I did before (which was fairly fast).
Maybe Mr Grok (Peter Knappler) is listening and can help.
I guess I would love some of those assembler msb's you C guys use, but I dont
know that is possible with java.
My current msb function is below for reference.
* Returns the integer position of the Most Significant Bit in the 64-bit long.
* Uses a pre-calculated, 65,536 byte lookup table for speed.
*
* @return Value from 0 to 63, specifying the location of the bit.
*/
//msb
public static int msb(long bitboard){
if (bitboard==0)
return -1;
int w = (int)((bitboard >>> 48) & 65535);
if (w != 0){
return msb_table[w]+48;
}
w = (int)((bitboard >>> 32) & 65535);
if (w != 0){
return msb_table[w]+32;
}
w = (int)((bitboard >>> 16) & 65535);
if (w != 0){
return msb_table[w]+16;
}
w = (int)(bitboard & 65535);
if (w != 0){
return msb_table[w];
}
return -1;
}
thanx
Scott
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.