Community
cancel
Showing results for 
Search instead for 
Did you mean: 
max-divulskiy
Beginner
57 Views

How correctly vectorizate loop?

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
57 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