3.20 Grouping structure accesses for vectorization

Writing loops to use all parts of a structure together is important for vectorization. Each part of the structure must be accessed within the same loop.

The following examples show how loop organization can affect vectorization.

Structure access resulting in a nonvectorizable loop:

for (...) { buffer[i].a = ....; }
for (...) { buffer[i].b = ....; }
for (...) { buffer[i].c = ....; }

Structure access resulting in a vectorizable loop

for (...)
{
    buffer[i].a = ....;
    buffer[i].b = ....;
    buffer[i].c = ....;
}
Related concepts
3.6 Automatic vectorization
3.21 Vectorization and struct member lengths
Related reference
8.189 --vectorize, --no_vectorize
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.