Computer Chess Club Archives


Search

Terms

Messages

Subject: question about importance of branchless code for speed

Author: Uri Blass

Date: 08:11:01 04/09/03


Supppose file1 and file2 are numbers between 0 and 7.

Am I correct to assume that in general it is better to not to use

int A[8];
If (file1<=file2) x+=A[file2-file1];


but instead of it something like

int PADDED_A[15];
int * const A = PADDED_A+7;
x+=A[file2-file1];

\\A[x]=0 for x=-1,x=-2,...x=-7


Uri



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