avx512/src/f11_260.c
// Multiply a narrow residue by a small constant. The result is reduced to 32
// bits.
Multiply a narrow residue by a small constant. The result is reduced to 32
bits.
Multiply a narrow residue by a small constant . The result is reduced to 32 bits .
void mul_narrow_const(
  residue_narrow_t *result, const residue_narrow_t *x, int32_t d) {
  residue_wide_t temp;
  for (int i = 0; i < NLIMBS; ++i) {
    temp.limbs[i] = ((uint64_t) x->limbs[i]) * d;
  }
  reduce_step_wide(&temp, &temp);
  __m512i _permute_final_result = _mm512_load_si512(permute_final_result);
  __m512i accum0 = _mm512_load_si512((__m512i*) &temp.limbs[0]);
  __m256i accum8 = _mm256_load_si256((__m256i*) &temp.limbs[8]);
  __m512i final_result = _mm512_permutex2var_epi32(
    accum0, _permute_final_result, _mm512_castsi256_si512(accum8));
  _mm512_store_si512((__m512i*) &result->limbs[0], final_result);
}
void mul_narrow_const ( residue_narrow_t * result , const residue_narrow_t * x , int32_t d ) { residue_wide_t temp ; for ( int i = 0 ; i < NLIMBS ; ++ i ) { temp . limbs [ i ] = ( ( uint64_t ) x -> limbs [ i ] ) * d ; } reduce_step_wide ( & temp , & temp ) ; __m512i _permute_final_result = _mm512_load_si512 ( permute_final_result ) ; __m512i accum0 = _mm512_load_si512 ( ( __m512i * ) & temp . limbs [ 0 ] ) ; __m256i accum8 = _mm256_load_si256 ( ( __m256i * ) & temp . limbs [ 8 ] ) ; __m512i final_result = _mm512_permutex2var_epi32 ( accum0 , _permute_final_result , _mm512_castsi256_si512 ( accum8 ) ) ; _mm512_store_si512 ( ( __m512i * ) & result -> limbs [ 0 ] , final_result ) ; }
Multiply a narrow residue by a small constant.
Multiply a narrow residue by a small constant .