Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

How correctly vectorizate loop?

max-divulskiy
Beginner
114 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
Black Belt
114 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.
Reply