Author: Dieter Buerssner
Date: 15:10:54 11/21/05
Go up one level in this thread
On November 20, 2005 at 16:38:38, Gerd Isenberg wrote:
> [...] Here some branchless substitution may pay off:
>
>fm = (depth < 0) ? fm1 : fm2;
I guess, you mean this as a substitution for
if (depth < 0)
fm = fm1;
else
fm = fm2;
I am surprised, that compilers are not able to do this themselves. I
>fm = fm2 + (depth < 0) * (fm1-fm2);
fm? are globals or constants? Why the need for the subtraction at the end?
Wouldn't a new constant be sufficient. I fear, I did not understand this. (I
believe I understand the "(depth < 0) * ..." part.
>How do you understand the indirect jmp works on amd64?
>I still found the qoute from amd optimization manual contradictory:
>"To avoid a comparison chain and its undesirable effects on branch prediction,
>replace the switch statement with a series of if-else statements..."
I don't understand it at all. Doesn't seem to make any sense.
Cheers,
Dieter
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.