SPRUIG3C January 2018 – August 2019 TDA4VM , TDA4VM-Q1
VCOP has a VEXITNZ instruction which conditionally breaks out of a given loop nest or repeat loop. The condition is based on comparing lane 0 of a vector register to zero. In Kernel-C, early exit is expressed as a conditional
goto
statement and a label, for example:
__vector acc1, acc2, flag;
for (int I1 = 0; I1 < 1; I1++)
{
for (int I4 = 0; I4 < num_pix[I0]; ++I4)
{
flag = (acc1 > acc2);
if (flag[0]) goto end_loop1;
}
}
end_loop1:;
For C7x translation, the migration tool simply copies the goto and label statements into the generated output verbatim and leaves it to the C7x compiler to generate the appropriate control flow. A loop with an early exit cannot use the NLC, but it may be software pipelined as a so-called “irregular loop”.