Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: some quotes on switch and indirect branches

Author: Dieter Buerssner

Date: 15:42:17 11/22/05

Go up one level in this thread


On November 22, 2005 at 03:23:46, Gerd Isenberg wrote:

>Wow, gcc - that's it. Shift is relative expensive on P4, something like four
>cycles (shift alu of the mmx-unit is used with "long" data pathes). Shift is
>cheap on amd cpus.

Hi Gerd, thanks for all the info and explanations, also in the other posts. In
this context I wonder, how shift compares to cmovx?

Anyway, I think you have guessed part of my opinion (besides the totally
technical discussion) - I would not care (anymore) to try to look whether
if/else or ? : produce better code. The other "tricks" you mentioned I might
consider differently. Eugene's message was also interesting in this context. No
doubt, we can save some cycles, by microoptimizing for some specific
environment. And it can be much fun, too. I don't doubt either, that it can be
worthwhile (in the sense of productive) for chess engines (many examples you
have shown for typical bitbase routines). But not in such "simple" cases, that
started this discussion. The next compiler/hardware combination may behave
different again. Here, I prefer to just trust the compiler. Of course, when the
discussed code is a clear bottleneck (which probably is not the case), more
effort is justified.

Cheers,
Dieter



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.