Previous | Next --- Slide 88 of 129
Back to Lecture Thumbnails

What happens when all ALUs only follow 1 path of the branch? Is the other (untaken) branch skipped?

If so, do we know which path to take because we stalled to compute the branch condition or because we employed branch prediction?

kayvonf

@thomask. A quality implementation would then avoid executing the untaken path, and performance would always be at peak SIMD utilization.

In simple block-structured code, here's an implementation that completely skips the if or else blocks if no iterations of the loop take that path.
vector_mask = compute_predicate()