Computer Chess Club Archives


Search

Terms

Messages

Subject: speed question

Author: Uri Blass

Date: 03:39:49 02/19/03


I try to do movei faster and there are things that are supposed to do it
slightly faster but for some reasons do it slower so I deleted them(Maybe it is
better if I ignore it because it is a compiler optimization noise but I do not
like to see the program slower even if it is only 0.1% slower).

Note that I do not use now compiler optimization except optimize for speed with
visual C++6.


Here is an example:
My function of adding pawn moves to the stack of moves get 2 numbers(from,to).

I found that special functions to generate white moves one square forward,white
moves 2 pawns forward,black pawns one square forward,...helped me to do movei
faster.

Common sense say that now I do not need 2 numbers in my functions because
I always have to=from-8 in

Here is my function.
to is always from-8 and the question is if I can take advantage of that fact.

static void gen_quietblackslowpawns(int from,int to)
{
	gen_t *g;
	if (to<=7)
	{
		gen_promote(from,to);
		return;
	}
	g=&gen_dat[first_move[ply+1]++];
	g->m.b.from=(char)from;
	g->m.b.to=(char) to;
	g->m.b.promote=0;
	g->m.b.bits=16;
	#if MODE!=MODE_PERFT
	g->score = history[from][to];
	g->index=-10000;
    #endif
}



This page took 0.02 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.