avx512/src/f11_260.c
// Shrink to 32 bits. Assumes reduction has already occurred, and wide storage
// is being used for vector compatibility.
Shrink to 32 bits. Assumes reduction has already occurred, and wide storage
is being used for vector compatibility.
Shrink to 32 bits . Assumes reduction has already occurred and wide storage is being used for vector compatibility .
void narrow(residue_narrow_t *result, const residue_wide_t * __restrict w) {
  __m256i collapse_perm = _mm256_load_si256((__m256i*) COLLAPSE);
  __m128i packed_result;
  #pragma clang loop unroll(full)
  for (int i = 0; i < NVECTORS; ++i) {
    __m256i x = _mm256_load_si256((__m256i*) (&w->limbs[i * VECTWIDTH]));
    packed_result = _mm256_castsi256_si128(
        _mm256_permutevar8x32_epi32(x, collapse_perm));
    _mm_store_si128((__m128i*) &result->limbs[i * VECTWIDTH], packed_result);
  }
}
void narrow ( residue_narrow_t * result , const residue_wide_t * __restrict w ) { __m256i collapse_perm = _mm256_load_si256 ( ( __m256i * ) COLLAPSE ) ; __m128i packed_result ; #pragma  clang loop unroll(full) for ( int i = 0 ; i < NVECTORS ; ++ i ) { __m256i x = _mm256_load_si256 ( ( __m256i * ) ( & w -> limbs [ i * VECTWIDTH ] ) ) ; packed_result = _mm256_castsi256_si128 ( _mm256_permutevar8x32_epi32 ( x , collapse_perm ) ) ; _mm_store_si128 ( ( __m128i * ) & result -> limbs [ i * VECTWIDTH ] , packed_result ) ; } }
Shrink to 32 bits.
Shrink to 32 bits .