This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [wide-int] int_traits <tree>
- From: Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: Richard Biener <rguenther at suse dot de>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 18 Oct 2013 17:36:20 +0100
- Subject: Re: [wide-int] int_traits <tree>
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LNX dot 2 dot 00 dot 1310161537220 dot 11149 at zhemvz dot fhfr dot qr> <525EB50F dot 2090003 at naturalbridge dot com> <87ppr56on1 dot fsf at talisman dot default> <525EFC33 dot 4010304 at naturalbridge dot com> <87hacg720z dot fsf at talisman dot default> <alpine dot LNX dot 2 dot 00 dot 1310171015000 dot 11149 at zhemvz dot fhfr dot qr> <87k3hc9n9w dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <alpine dot LNX dot 2 dot 00 dot 1310171309390 dot 11149 at zhemvz dot fhfr dot qr> <87bo2o9kow dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <alpine dot LNX dot 2 dot 00 dot 1310171406490 dot 11149 at zhemvz dot fhfr dot qr> <877gdc9fxb dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <alpine dot LNX dot 2 dot 00 dot 1310171542090 dot 11149 at zhemvz dot fhfr dot qr> <87vc0w8034 dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <52601614 dot 3040009 at naturalbridge dot com> <alpine dot LNX dot 2 dot 00 dot 1310181046300 dot 11149 at zhemvz dot fhfr dot qr> <52613400 dot 20008 at naturalbridge dot com> <87hace8w4u dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <52615619 dot 2060604 at naturalbridge dot com>
Kenneth Zadeck <zadeck@naturalbridge.com> writes:
> I am a little confused here. what is the reason for doing the the
> is_sign_extended thing?
> is the point of deferring the canonization that we can avoid the use of
> the scratch array until the value is actually used. then we
> canonicalize on demand?
The idea is that we conservatively treat upper bits as undefined when
reading, just like you did originally. But (assuming I understood the
idea correctly) the traits class has an ::is_sign_extended member that
may be able to tell you at compile time that the upper bits are actually
sign-extended. This would be true for wide_int and rtx, but not tree.
We can then use ::is_sign_extended to add fast paths to the functions
that are better with sign-extended inputs (like eq_p and lts_p) without
adding any extra run-time checks.
Thanks,
Richard