Loop Constructs

Loops can be formed with the usual for and while-do, or repeat-until constructs or by using a goto and a label. However, the loops must have a single entry and a single exit to be vectorized.

Correct Usage

while (i < n)

{

/* if branch inside body of loop */

a[i] = b[i] * c[i];

if (a[i] < 0.0)

{

a[i] = 0.0;

}

i++;

}

Incorrect Usage

while (i < n)

{

if (condition) break;

/* 2nd exit */

++i;

}