[gray-matter] r1619 committed - a mite fewer instructions.

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 2, 2010, 11:22:08 PM8/2/10
to gray-matter-...@googlegroups.com
Revision: 1619
Author: protonspring
Date: Mon Aug 2 20:21:16 2010
Log: a mite fewer instructions.


http://code.google.com/p/gray-matter/source/detail?r=1619

Modified:
/trunk/inc/board_base.h
/trunk/src/board_base.cpp

=======================================
--- /trunk/inc/board_base.h Mon Aug 2 19:58:09 2010
+++ /trunk/inc/board_base.h Mon Aug 2 20:21:16 2010
@@ -39,15 +39,14 @@
class board_base
{
//precomputed single bit masks
- static bitboard_t singleBitMasks[8][8];
+ static bitboard_t BIT_MSK[8][8];

public:
inline static int BIT_IDX(int x, int y) {return ((y) << 3 |
(x));}
- inline static bitboard_t BIT_MSK(int x, int y) {return
singleBitMasks[x][y];}
inline static bool BIT_GET(bitboard_t b, int x, int y) {return
((b) >> BIT_IDX(x, y) & 1);}
- inline static void BIT_CLR(bitboard_t& b, unsigned x, unsigned y)
{(b) &= ~BIT_MSK(x, y);}
- inline static void BIT_SET(bitboard_t& b, int x, int y) {(b) |=
BIT_MSK(x, y);}
- inline static bitboard_t BIT_MOV(bitboard_t& b, int x1, int y1, int x2,
int y2) {return ((b) ^= BIT_MSK(x1, y1) | BIT_MSK(x2, y2));}
+ inline static void BIT_CLR(bitboard_t& b, unsigned x, unsigned y)
{(b) &= ~BIT_MSK[x][y];}
+ inline static void BIT_SET(bitboard_t& b, int x, int y) {(b) |=
BIT_MSK[x][y];}
+ inline static bitboard_t BIT_MOV(bitboard_t& b, int x1, int y1, int x2,
int y2) {return ((b) ^= BIT_MSK[x1][y1] | BIT_MSK[x2][y2]);}

inline static int ROW_NUM(int x,int y,int a){return ((a) ==
ZERO ? (y) : (x));}
inline static int ROW_LOC(int x,int y,int a){return ((a) ==
ZERO ? (x) : 7 - (y));}
=======================================
--- /trunk/src/board_base.cpp Mon Aug 2 19:58:09 2010
+++ /trunk/src/board_base.cpp Mon Aug 2 20:21:16 2010
@@ -160,7 +160,7 @@
bitboard_t board_base::key_en_passant[8];
bitboard_t board_base::key_on_move;

-uint64_t board_base::singleBitMasks[8][8];
+uint64_t board_base::BIT_MSK[8][8];


/*----------------------------------------------------------------------------*\
|
board_base() |
@@ -174,7 +174,7 @@
//compute single bit masks
for (int i=0;i<8;++i)
for (int j=0;j<8;++j)
- singleBitMasks[j][i] = 1ULL << (i*8+j);
+ BIT_MSK[j][i] = 1ULL << (i*8+j);

if (!precomputed_board_base)
{

Reply all
Reply to author
Forward
0 new messages