avx512/src/f11_260.c
// Takes advantage of the fact that if a residue z *is zero* then after setting
// one coefficient to T/2, all the remaining coefficients should be near to
// T/2. They should therefore resolve all carries in a single step, and all be
// equal to the same value. Some other value may not reduce completely, but this
// is fine, we will know it is not zero.
Takes advantage of the fact that if a residue z *is zero* then after setting
one coefficient to T/2, all the remaining coefficients should be near to
T/2. They should therefore resolve all carries in a single step, and all be
equal to the same value. Some other value may not reduce completely, but this
is fine, we will know it is not zero.
Takes advantage of the fact that if a residue z * is zero * then after setting one coefficient to T / 2 all the remaining coefficients should be near to T / 2 . They should therefore resolve all carries in a single step and all be equal to the same value . Some other value may not reduce completely but this is fine we will know it is not zero .
int equal_narrow(const residue_narrow_t *x, const residue_narrow_t *y) {
  residue_narrow_t temp;
  sub_narrow(&temp, x, y);
  int32_t delta = -temp.limbs[0] + (T / 2);
  for (int i = 0; i < NLIMBS; ++i) {
    temp.limbs[i] += delta;
  }
  reduce_step_narrow(&temp, &temp);
  delta = temp.limbs[0];
  int result = 0;
  for (int i = 1; i < NLIMBS; ++i) {
    result |= (temp.limbs[i] ^ delta);
  }
  return !result;
}
int equal_narrow ( const residue_narrow_t * x , const residue_narrow_t * y ) { residue_narrow_t temp ; sub_narrow ( & temp , x , y ) ; int32_t delta = - temp . limbs [ 0 ] + ( T / 2 ) ; for ( int i = 0 ; i < NLIMBS ; ++ i ) { temp . limbs [ i ] += delta ; } reduce_step_narrow ( & temp , & temp ) ; delta = temp . limbs [ 0 ] ; int result = 0 ; for ( int i = 1 ; i < NLIMBS ; ++ i ) { result |= ( temp . limbs [ i ] ^ delta ) ; } return ! result ; }
Takes advantage of the fact that if a residue z *is zero* then after setting
one coefficient to T/2, all the remaining coefficients should be near to
T/2.
Takes advantage of the fact that if a residue z * is zero * then after setting one coefficient to T / 2 all the remaining coefficients should be near to T / 2 .