I was wrong.
Steven Schveighoffer
schveiguy at yahoo.com
Thu Aug 14 10:03:29 PDT 2008
"superdan" wrote
> Jb Wrote:
>
>>
>> "superdan" <super at dan.org> wrote in message
>> news:g81e1l$18js$1 at digitalmars.com...
>> > downs Wrote:
>>
>> >> Null: 729908
>> >> Naive: 1615314
>> >> Speculative for B: 1692860
>> >> Speculative for B/C: 1664040
>> >
>> > the whole premise of speculation is it oils the common path. you have
>> > uniform probabilities.
>> > what you gain on speculating for B you lose in the extra test when
>> > misspeculating on others.
>> > so to really test speculation make B like 90% of cases and retry.
>>
>> To speculate localy you still have to lookup the class info, compare it
>> to
>> the speculated object type, and then conditionaly branch. You cant avoid
>> a
>> conditional branch, and as it will share the same pattern as the indirect
>> jump, and (in most cases) the same prediction mechanism, neither will be
>> better predicted than the other.
>
> no that's wrong. conditional branch is better speculated than indirect
> jump. they share no other hardware than the instruction fetching pipe. the
> mechanism for conditional branch speculation is that stuff is executed in
> parallel on both branches inside the pipeline. the branch that makes it is
> committed. the other is retired without getting to write to the register
> file or memory. indirect jump is a whole different business altogether.
>
>> So the point is that you cant make the common path any faster unless you
>> actualy *inline* the speculated method. In fact if you dont inline you
>> are
>> most probably making the situation worse because you are replacing
>> this...
>
> you are right here tho for the wrong reasons :) yeah speculation is good
> if there are a few good chunky instructions to eat while speculating. if
> it's a function call that in turn is just a ret... the results are nothing
> to write home about. as it's been shown.
>
> processors today are so complicated there's no chance to have relevant
> synthetic tests. when checking for speed you always must use realistic
> loads. if method speculation as in here shows nothing on empty functions
> that's nothing. i've seen much weirder things. tests must be held on 5-6
> real benchmarks to be any good.
Who the **** are you, and what did you do with superdan? ;)
-Steve
More information about the Digitalmars-d
mailing list