Computer Chess Club Archives


Search

Terms

Messages

Subject: 3 optimization questions

Author: martin fierz

Date: 05:42:39 06/19/03


i've been wondering about whether my checkers program could benefit from some
IA-32 features, perhaps some specialist can answer me some questions - i'm using
MSVC.net:

1) prefetching
my program spends 10% of it's time on a single line according to AMD
codeanalyst, the line where it reads an entry from the hashtable. since i could
theoretically compute the hashtable index long before accessing the hashtable, i
could prefetch this hashtable data. is there a way to do this in C? i guess not,
so is there a way to do this in assembly code in MSVC? if yes, does somebody
have some code for this? is anybody doing this already?

2) vectorized computation
my board representation is 4 unsigned integers, my move representation too. my
domove operates on these two structures by XORin each of the board integers with
a move integer. is this vectorized by the compiler, or do i have to do (can i
do?) this myself somehow?

3) vectorized comparison
i do a lot of pattern matching in my evaluation function with the position (4
ints as above). that looks about like this:

if( (board.bm & C1 == C1) && (board.wm & C2 == C2) && (board.bk & C3 == C3))
  do something

is there a way to use MMX registers to compare larger numbers (eg 128bit) with
one instruction? if yes, how can i do this?

cheers
  martin



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.