Next:Miscellaneouspoly_int routines, Previous:Computing bounds onpoly_ints, Up:Sizes and offsets as runtime invariants [Contents][Index]
poly_ints ¶Apoly_int<n,T> can be constructed from up ton individualT coefficients, with the remaining coefficientsbeing implicitly zero. In particular, this means that everypoly_int<n,T> can be constructed from a singlescalarT, or something compatible withT.
Also, apoly_int<n,T> can be constructed fromapoly_int<n,U> ifT can be constructedfromU.
The following functions provide other forms of conversion,or test whether such a conversion would succeed.
Return true ifpoly_intvalue is a compile-time constant.
Return true ifpoly_intvalue is a compile-time constant,storing it inc1 if so.c1 must be able to hold allconstant values ofvalue without loss of precision.
Assert thatvalue is a compile-time constant and return its value.When using this function, please add a comment explaining why thecondition is known to hold (for example, because an earlier phaseof analysis rejected non-constants).
Return true if ‘poly_int<N,T>’value can berepresented without loss of precision as a‘poly_int<N,HOST_WIDE_INT>’, storing it in thatform inp2 if so.
Return true if ‘poly_int<N,T>’value can berepresented without loss of precision as a‘poly_int<N,unsigned HOST_WIDE_INT>’, storing it in thatform inp2 if so.
Forcibly convert each coefficient of ‘poly_int<N,T>’value toHOST_WIDE_INT, truncating any that are out of range.Return the result as a ‘poly_int<N,HOST_WIDE_INT>’.
Forcibly convert each coefficient of ‘poly_int<N,T>’value tounsigned HOST_WIDE_INT, truncating any that areout of range. Return the result as a‘poly_int<N,unsigned HOST_WIDE_INT>’.
Return apoly_int with the same value asvalue, but withthe coefficients converted fromHOST_WIDE_INT towide_int.precision specifies the precision of thewide_int cofficients;if this is wider than aHOST_WIDE_INT, the coefficients ofvalue will be sign-extended to fit.
Likewi::shwi, except thatvalue has coefficients oftypeunsigned HOST_WIDE_INT. Ifprecision is wider thanaHOST_WIDE_INT, the coefficients ofvalue will bezero-extended to fit.
Return apoly_int of the same type asvalue, sign-extendingevery coefficient from the lowprecision bits. This in effectapplieswi::sext to each coefficient individually.
Likewi::sext, but for zero extension.
Convertvalue to apoly_wide_int in which each coefficienthasprecision bits. Extend the coefficients according tosign if the coefficients have fewer bits.
Convertvalue to apoly_offset_int, extending its coefficientsaccording tosign if they have fewer bits thanoffset_int.
Convertvalue to apoly_widest_int, extending its coefficientsaccording tosign if they have fewer bits thanwidest_int.
Next:Miscellaneouspoly_int routines, Previous:Computing bounds onpoly_ints, Up:Sizes and offsets as runtime invariants [Contents][Index]