/* Return the value of element I of VECTOR_CST T as a wide_int. */
-wide_int
+static poly_wide_int
vector_cst_int_elt (const_tree t, unsigned int i)
{
/* First handle elements that are directly encoded. */
unsigned int encoded_nelts = vector_cst_encoded_nelts (t);
if (i < encoded_nelts)
- return wi::to_wide (VECTOR_CST_ENCODED_ELT (t, i));
+ return wi::to_poly_wide (VECTOR_CST_ENCODED_ELT (t, i));
/* Identify the pattern that contains element I and work out the index of
the last encoded element for that pattern. */
/* If there are no steps, the final encoded value is the right one. */
if (!VECTOR_CST_STEPPED_P (t))
- return wi::to_wide (VECTOR_CST_ENCODED_ELT (t, final_i));
+ return wi::to_poly_wide (VECTOR_CST_ENCODED_ELT (t, final_i));
/* Otherwise work out the value from the last two encoded elements. */
tree v1 = VECTOR_CST_ENCODED_ELT (t, final_i - npatterns);
tree v2 = VECTOR_CST_ENCODED_ELT (t, final_i);
- wide_int diff = wi::to_wide (v2) - wi::to_wide (v1);
- return wi::to_wide (v2) + (count - 2) * diff;
+ poly_wide_int diff = wi::to_poly_wide (v2) - wi::to_poly_wide (v1);
+ return wi::to_poly_wide (v2) + (count - 2) * diff;
}
/* Return the value of element I of VECTOR_CST T. */
extern bool initializer_zerop (const_tree, bool * = NULL);
extern bool initializer_each_zero_or_onep (const_tree);
-extern wide_int vector_cst_int_elt (const_tree, unsigned int);
extern tree vector_cst_elt (const_tree, unsigned int);
/* Given a vector VEC, return its first element if all elements are