Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Various compiler questions

Author: Bo Persson

Date: 10:19:29 01/15/02

Go up one level in this thread


On January 14, 2002 at 17:32:25, James Robertson wrote:

>On January 14, 2002 at 12:39:33, Bo Persson wrote:
>
[...]
>>The standard answer is, of course: "It depends".
>>Is the function pointer stored somewhere? Is there a cost in retrieving it (a
>>parameter passed in a register, or is it stored in uncached memory) ?
>>
>>A definite cost is that branch prediction logic will have a really hard time
>>predicting where the branch is going.
>
>How serious a problem is this? I have heard that it depends a lot on the
>processor. For instance, the P4 is supposed to have problems this way. Could you
>please elaborate on this a little bit?
>
>Thanks,
>James
>

I have no specific info on just *how* bad it is. As always, "it depends", if you
solve another problem by this, it might be good. The general problem is that a
function pointer is like "jump somewhere (location supplied later)", which I
believe is very hard to figure out for the CPU. To me it looks like the CPU will
reach the jump with an empty pipeline, which is not too good.


Bo Persson
bop2@telia.com



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.