基本上,我想对字节数组执行AND掩码。我知道代码将是这样的:
char *arr = (char*)_mm_malloc(num_bytes,8);
//fill the array with some values
__m256i mask = _mm256_set1_epi8(0x12);
for(uint32_t i=0; i<num_bytes; i+=32){
//load for chars is unknown to me
__m256i val = _mm256_load_char(arr+i);
val = _mm256_and_si256 (val, mask);
//perform extra operations with the result
}
Run Code Online (Sandbox Code Playgroud)
但是我不知道如何将32字节的数据包安全地加载到256寄存器中。