By: someotherdude (someotherdude.delete@this.none.none.none.none), July 7, 2015 3:01 pm
Room: Moderated Discussions
Paul A. Clayton (paaronclayton.delete@this.gmail.com) on July 7, 2015 7:43 am wrote:
> Gabriele Svelto (gabriele.svelto.delete@this.gmail.com) on July 7, 2015 2:50 am wrote:
> > SHK (no.delete@this.mail.com) on July 6, 2015 12:41 pm wrote:
> > > Maybe that kind of hardware optimization is there for old non-recompiled code?
> >
> > It also works for stores which you cannot handle with isel.
>
> To "predicate" a store, one selects the address (either the ordinary address or a
> safe but unused address ) and performs the store. A store is more expensive than just
> an ALU operation, but it could still be cheaper than a branch misprediction.
I see that you put predicate in quotes, but I think you underweight the cost of doing an actual store. You're discounting the possibilities and costs of a TLB miss, a cache miss, a page miss, etc. every one of which could be much greater in cost than the branch mispredict, perhaps even by magnitudes.
To truly predicate a store, the MMU translation and the RWITM won't happen because the instruction won't have issued out of the reservation station until the condition code is known, after which there wouldn't be any point in actually doing all the stuff for an actually executed store. And even then, you don't want those TLB miss, cache miss, read for ownership, etc. side effects to happen for code like this:
> Gabriele Svelto (gabriele.svelto.delete@this.gmail.com) on July 7, 2015 2:50 am wrote:
> > SHK (no.delete@this.mail.com) on July 6, 2015 12:41 pm wrote:
> > > Maybe that kind of hardware optimization is there for old non-recompiled code?
> >
> > It also works for stores which you cannot handle with isel.
>
> To "predicate" a store, one selects the address (either the ordinary address or a
> safe but unused address ) and performs the store. A store is more expensive than just
> an ALU operation, but it could still be cheaper than a branch misprediction.
I see that you put predicate in quotes, but I think you underweight the cost of doing an actual store. You're discounting the possibilities and costs of a TLB miss, a cache miss, a page miss, etc. every one of which could be much greater in cost than the branch mispredict, perhaps even by magnitudes.
To truly predicate a store, the MMU translation and the RWITM won't happen because the instruction won't have issued out of the reservation station until the condition code is known, after which there wouldn't be any point in actually doing all the stuff for an actually executed store. And even then, you don't want those TLB miss, cache miss, read for ownership, etc. side effects to happen for code like this:
if (ptr) {
*ptr = 123;
}