Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

How correctly vectorizate loop?

max-divulskiy
Beginner
289 Views
Please rompt how correctly vectorizate this cycle:
[bash]_CRT_ALIGN(16) const	UINT8	XorBitsArray[] = {...};
_CRT_ALIGN(16)			UINT8	MassX[] = {...};
_CRT_ALIGN(16)			UINT8	MassR[] = {...};

for (UINT i = 0; i < sPeriodLenth; i++ )
{
	MassR = XorBitsArray[ MassX ];
}[/bash]

Outputs the following message:
[bash]loop was not vectorized: unsupported data type[/bash]
0 Kudos
1 Reply
TimP
Honored Contributor III
289 Views
"vectorizing" such a loop (packing operands into an _m128 before storing) would require either SSE4.1 (or newer) instructions or #pragma vector aligned. It may work only with indexing by an int array. In such a simple loop, packing is unlikely to have an advantage, as the hardware packs the operands into a fill buffer anyway before updating cache.
0 Kudos
Reply