Author: Gerd Isenberg
Date: 10:09:26 12/04/03
Go up one level in this thread
> >OK. If I interpret that correctly, if I occasionally call this with a >zero value, the cmov might be better due to avoiding the mis-predicted >branch. But if it is always non-zero, then the jnz is better. > My guess too, specially here, with none zero values cmov approach only waste time by loading a constant which is skipped by the jmp. If you have both values already in a register, e.g. after a compare, e.g. for min/max/abs, cmov may be faster. Specially if the branch prediction heuristic gets confused about these jump targets by none predictical pattern ;-)
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.