public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Georg-Johann Lay <avr@gjlay.de>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gcc@gcc.gnu.org
Subject: Re: [named address] ice-on-valid: in postreload.c:reload_cse_simplify_operands
Date: Sun, 21 Aug 2011 16:43:00 -0000	[thread overview]
Message-ID: <4E513581.5090100@gjlay.de> (raw)
In-Reply-To: <201108181437.p7IEbixY006516@d06av02.portsmouth.uk.ibm.com>

Ulrich Weigand schrieb:
> Georg-Johann Lay wrote:
> 
>>http://gcc.gnu.org/ml/gcc/2011-08/msg00131.html
>>
>>Are you going to install that patch? Or maybe you already installed it?
> 
> No, it isn't approved yet (in fact, it isn't even posted for approval).
> Usually, patches that add new target macros, or new arguments to target
> macros, but do not actually add any *exploiter* of the new features,
> are frowned upon ...

I thought about implementing a "hidden" named AS first and not exposing 
it to user land, e.g. to be able to do optimizations like
    http://gcc.gnu.org/PR49857
    http://gcc.gnu.org/PR43745
which need named AS to express that some pointers/accesses are different.

The most prominent drawback of named AS at the moment is that AVR has 
few address registers and register allocation often regerates unpleasant 
code or even runs into spill fails.

The AS in question can only be accessed by means of post-increment 
addressing via one single hard register.

> Thus, I'd prefer to wait until you have patch ready that exploits this
> in the AVR backend, and then submit the whole series.
> 
>>Then, I wonder how the following named AS code translates:
>>
>>int a = *((__as int*) 1000);
>>
>>As const_int don't have a machmode (yet), I guess the above line just 
>>reads from generic AS and reading from a specific address from named AS 
>>cannot work.
> 
> This should work fine.  Address space processing doesn't really depend
> on the machine mode; the address space is annotated to the MEM RTX
> directly.  Code like the above ought to generate a MEM with either
> an immediate CONST_INT operand or one with the immediate loaded into
> a register, depending on what the target supports, but in either case
> the MEM_ADDR_SPACE will be set correctly.  It's then up the target to
> implement the access as appropriate.

Thanks for pointing this out. I just used the mmode in my implementation 
instead of MEM_ADDR_SPACE. My bad.

>>Moreover, INDEX_REG_CLASS, REGNO_OK_FOR_INDEX_P, HAVE_PRE_INCREMENT et 
>>al. and maybe others are AS-dependent.
> 
> I agree for INDEX_REG_CLASS and REGNO_OK_FOR_INDEX_P.  In fact, I'd
> suggest they should first be converted to look similar to base registers
> (i.e. add MODE_CODE_INDEX_REG_CLASS and REGNO_MODE_CODE_OK_FOR_INDEX_P)
> and then add address space support to those extended macros, so as to
> avoid having to change lots of back-ends.   Do you need this for AVR?
> I could add that to the patch I posted previously ...

No, that's not needed for AVR.  I just noticed it.

> Now for HAVE_PRE_INCREMENT, I don't think we need anything special.
> This is used just as a short-cut to bypass pre-increment handling
> completely on targets that don't support it at all.  On targets
> that *do*, there will always be additional requirement on just
> which memory accesses support pre-increment.  Therefore, the
> middle-end will still always check the target's legitimate_address
> callback to ensure any particular pre-incremented memory access
> is actually valid.  This mechanism can already look at the address
> space to make its decision ...

Thanks for all your explanations. Johann

> Bye,
> Ulrich


  reply	other threads:[~2011-08-21 16:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 13:43 Georg-Johann Lay
2011-08-04 16:20 ` Ulrich Weigand
2011-08-04 16:26   ` DJ Delorie
2011-08-04 16:33     ` Ulrich Weigand
2011-08-04 17:28   ` Georg-Johann Lay
2011-08-05 10:19     ` Ulrich Weigand
2011-08-05 12:47       ` Georg-Johann Lay
2011-08-05 13:24         ` Ulrich Weigand
2011-08-05 14:09           ` Michael Matz
2011-08-05 14:29             ` Ulrich Weigand
2011-08-05 20:43     ` Ulrich Weigand
2011-08-05 20:47       ` DJ Delorie
2011-08-05 21:01         ` Ulrich Weigand
2011-08-05 21:08           ` DJ Delorie
2011-08-08 11:38       ` Georg-Johann Lay
2011-08-09 17:16         ` Ulrich Weigand
2011-08-10 14:04           ` Georg-Johann Lay
2011-08-17 17:44             ` Georg-Johann Lay
2011-08-18 14:38               ` Ulrich Weigand
2011-08-21 16:43                 ` Georg-Johann Lay [this message]
2011-08-22 12:39                   ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E513581.5090100@gjlay.de \
    --to=avr@gjlay.de \
    --cc=gcc@gcc.gnu.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).