INNER CODE UNIT · C
shufbidx
pq-crystals/dilithium · avx2/poly.c:1008
const __m256i shufbidx = _mm256_set_epi8(-1, 9, 8, 7,-1, 7, 6, 5,-1, 5, 4, 3,-1, 3, 2, 1,
-1, 8, 7, 6,-1, 6, 5, 4,-1, 4, 3, 2,-1, 2, 1, 0);
const __m256i srlvdidx = _mm256_set_epi32(6,4,2,0,6,4,2,0);
const __m256i mask = _mm256_set1_epi32(0x3FFFF);
const __m256i gamma1 = _mm256_set1_epi32(GAMMA1);
DBENCH_START();
for(i = 0; i < N/8; i++) {
f = _mm256_loadu_si256((__m256i *)&a[18*i]);
f = _mm256_permute4x64_epi64(f,0x94);
f = _mm256_shuffle_epi8(f,shufbidx);
f = _mm256_srlv_epi32(f,srlvdidx);
f = _mm256_and_si256(f,mask);
f = _mm256_sub_epi32(gamma1,f);
_mm256_store_si256(&r->vec[i],f);
}
DBENCH_STOP(*tpack);