By: Paul A. Clayton (paaronclayton.delete@this.gmail.com), July 6, 2015 3:02 pm
Room: Moderated Discussions
SHK (no.delete@this.mail.com) on July 6, 2015 12:41 pm wrote:
> Maynard Handley (name99.delete@this.name99.org) on July 6, 2015 10:25 am wrote:
>
> >
> > The IBM branch over one instruction is neat, but, like you said
> > for forming immediates, it reflects a hole in the iSA.
>
> Power has a conditional move (isel) since v2.06 so a programmer/compiler
> should choose it over branches if it's just to skip 1-2 instructions.
>
> Maybe that kind of hardware optimization is there for old non-recompiled code?
The compiler should chose a select instruction if the branch is unpredictable. If the branch is predictable (or at least if rarely taken), then a branch instruction is more appropriate. If the compiler does not know (or the predictability varies dynamically), then having the hardware dynamically predicate makes some sense. (Called to supper, so will have to come back tomorrow.)
> Maynard Handley (name99.delete@this.name99.org) on July 6, 2015 10:25 am wrote:
>
> >
> > The IBM branch over one instruction is neat, but, like you said
> > for forming immediates, it reflects a hole in the iSA.
>
> Power has a conditional move (isel) since v2.06 so a programmer/compiler
> should choose it over branches if it's just to skip 1-2 instructions.
>
> Maybe that kind of hardware optimization is there for old non-recompiled code?
The compiler should chose a select instruction if the branch is unpredictable. If the branch is predictable (or at least if rarely taken), then a branch instruction is more appropriate. If the compiler does not know (or the predictability varies dynamically), then having the hardware dynamically predicate makes some sense. (Called to supper, so will have to come back tomorrow.)