This is the mail archive of the
mailing list for the GCC project.
Re: [C PATCH] Discard P - (P + CST) optimization in pointer_diff (PR c/61240)
- From: Mike Stump <mikestump at comcast dot net>
- To: Jeff Law <law at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 6 Aug 2014 12:33:16 -0700
- Subject: Re: [C PATCH] Discard P - (P + CST) optimization in pointer_diff (PR c/61240)
- Authentication-results: sourceware.org; auth=none
- References: <20140804101856 dot GB24292 at redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1408041224210 dot 20733 at zhemvz dot fhfr dot qr> <20140804113836 dot GD24292 at redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1408041404040 dot 20733 at zhemvz dot fhfr dot qr> <20140805143652 dot GG24292 at redhat dot com> <53E13B1D dot 5050401 at redhat dot com> <20140806082219 dot GI24292 at redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1408061021280 dot 20733 at zhemvz dot fhfr dot qr> <53E25225 dot 8050407 at redhat dot com>
On Aug 6, 2014, at 9:04 AM, Jeff Law <email@example.com> wrote:
>> which we may restrict better with checking whether the pointer
>> uses a partial integer mode. Not sure how PSImode -> SImode
>> "extends" on RTL?
> Well, at least on the mn102, I defined both a zero and sign extension for PSI -> SI. So whichever one the generic parts of the compiler needed, the backend provided.
I have a port that defines exactly the bit width of all partials. The extending of it is machine independent and obvious. Though, there are places in the backend that just call the conversion operation they are interested in and pretend they can’t understand what’s going on. I tend to prefer the backend know and I prefer to explain to it the width of all the partials.
Wait, did I submit that?
/* 20-bit address */
PARTIAL_INT_MODE (SI, 20, PSI);
ah, yes, I think I did. You scared me for a second.
> As to what bits are modified, that's target dependent as the precise size of the partial modes is target dependent.
GET_MODE_PRECISION (mode) is the precision of all modes.
> That's one of the things that would be largely made irrelevant by DJ's proposed changes. Instead of using PSImode,
> we'd be able to define modes of precisely the number of bits one of these targets needs.
Gosh, we already do that. GET_MODE_PRECISION (mode) is exactly the width:
PARTIAL_INT_MODE (MODE, PRECISION, NAME); |
declares a mode of class PARTIAL_INT with the same size as |
MODE (which must be an INT mode) and precision PREC. |
Optionally, NAME is the new name of the mode. NAME is the |
name of the mode. |