selectively xor-ing elements of a list with AVX2 instructions
问题 I want to speed up the following operation with AVX2 instructions, but I was not able to find a way to do so. I am given a large array uint64_t data[100000] of uint64_t's, and an array unsigned char indices[100000] of bytes. I want to output an array uint64_t Out[256] where the i-th value is the xor of all data[j] such that index[j]=i . A straightforward implementation of what I want is this: uint64_t Out[256] = {0}; // initialize output array for (i = 0; i < 100000 ; i++) { Out[Indices[i]] ^