Is it practical to make a bitboard class using two 32 bit ints?
Or does that slow it down immensly so that all gains are forfeit?
It should work faster on a 32-bit computer?
--
Mail sent by: Mats Forsén ( Garnax )
- "My software never has bugs. It just develops random features."
E-mail: t95f...@ava.taby.se / gar...@texoma.net
WWW: Muds: http://www.texoma.net/~garnax/main.html
Svenskmud: http://www4.torget.se/users/g/garnax/
Programming: http://elev.ava.taby.se/~t95forsm/programming/
> Hi,
> =
> Is it practical to make a bitboard class using two 32 bit ints?
Yes, it works very well. I have done this with MS VC++ 4.x and 5.0,
using inline functions for the operations. The optimizer seems to
work better for 32-bit ints than for the newer __int64 data type.
The result is *very* fast code!
> Or does that slow it down immensly so that all gains are forfeit?
No, not at all.
> It should work faster on a 32-bit computer?
Yes, it does!
Bo Persson
bo.pe...@mbox3.swipnet.se
: Is it practical to make a bitboard class using two 32 bit ints?
: Or does that slow it down immensly so that all gains are forfeit?
: It should work faster on a 32-bit computer?
it is certainly possible. The difficult comes with comparing to a
compiler that does this itself, because it can optimize the code a
little better. Shifts are particularly hard. tricks like b&b-1
also cause grief... but it could certainly work...
For years I have used a union that includes an array of two 32-bit values,
and another array of 8-bit values.
I don't use bitmaps for move generation, but I use them for other stuff.
This seems to work fine.
You can also just use __int64 or long long or whatever you have on your
compiler, write the code to use this, and suffer some minor performance
penalty (it was minor for me, at least).
bruce
On Sun, 14 Sep 1997 11:06:30 GMT, gar...@texoma.net (Mats Forsén)
wrote:
>Hi,
>
>Is it practical to make a bitboard class using two 32 bit ints?
>Or does that slow it down immensly so that all gains are forfeit?
>It should work faster on a 32-bit computer?
This is what I'm doing with Knowchess. It works fine for me,
it needed very little "help" to work well. Having half-bitmaps
is nice, too, because you don't always need the whole thing.
Sliding pieces can be handled with 32-bit maps, for example.
Dan
>This is what I'm doing with Knowchess. It works fine for me,
>it needed very little "help" to work well. Having half-bitmaps
>is nice, too, because you don't always need the whole thing.
>Sliding pieces can be handled with 32-bit maps, for example.
Ohh.. sounds nice.. How did you 'overload the operators'
without a significant overhead?