By: Gabriele Svelto (gabriele.svelto.delete@this.gmail.com), July 8, 2015 5:22 am
Room: Moderated Discussions
Paul A. Clayton (paaronclayton.delete@this.gmail.com) on July 8, 2015 4:46 am wrote:
> Yes, using a select instruction to avoid a store is more work, but if the processor does not support dynamic
> hammock branch predication (or predicated stores) then doing this extra work may still be less expensive
> than the alternative (frequent branch mispredictions flushing many instructions). When a mispredicted branch
> can easily discard tens of operations, sometimes even expensive alternatives make sense.
I wasn't arguing against that, I was just pointing out that your argument works both ways. You can achieve the same effect even without an isel instruction with a moderately small additional cost (it'll probably take you 3 instructions instead of one) and thus might also be beneficial in certain scenarios. It just skews the cost/benefit tradeoff a little more but has the huge advantage of not requiring 3-input-sources instructions. So in my eyes having or not having isel doesn't fundamentally change the equation; having hammock prediction does on the other hand since you don't have to worry about any of this anymore, the hardware takes care of it. Even from a compiler perspective it's quite a change, in one case you need to do branch conversion (even if you don't have isel but want to emulate it) in the other you just emit straightforward code which just works™.
> Yes, using a select instruction to avoid a store is more work, but if the processor does not support dynamic
> hammock branch predication (or predicated stores) then doing this extra work may still be less expensive
> than the alternative (frequent branch mispredictions flushing many instructions). When a mispredicted branch
> can easily discard tens of operations, sometimes even expensive alternatives make sense.
I wasn't arguing against that, I was just pointing out that your argument works both ways. You can achieve the same effect even without an isel instruction with a moderately small additional cost (it'll probably take you 3 instructions instead of one) and thus might also be beneficial in certain scenarios. It just skews the cost/benefit tradeoff a little more but has the huge advantage of not requiring 3-input-sources instructions. So in my eyes having or not having isel doesn't fundamentally change the equation; having hammock prediction does on the other hand since you don't have to worry about any of this anymore, the hardware takes care of it. Even from a compiler perspective it's quite a change, in one case you need to do branch conversion (even if you don't have isel but want to emulate it) in the other you just emit straightforward code which just works™.