public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to define special requirements for an address operand?
       [not found] <1337773963.10856.ezmlm@gcc.gnu.org>
@ 2012-05-25 12:11 ` Setjem Setjem
  2012-05-25 14:03   ` Ian Lance Taylor
  2012-05-25 14:17   ` Georg-Johann Lay
  0 siblings, 2 replies; 3+ messages in thread
From: Setjem Setjem @ 2012-05-25 12:11 UTC (permalink / raw)
  To: gcc-help

Hi,
I'am trying to write a backend for my own target system.
The target has two pointer registers but only one of them can be used to read data from memory and the other one to write data into memory.

How could i tell the compiler to use the correct register for the respective operation?

I have tried to copy the address into the correct register in the define_expand "mov<mode>", but this seems to confuse the compiler and not working always.
I also tried to describe it in the target hook TARGET_LEGITIMATE_ADDRESS_P, but there i have no idea how to find out which operation is performed (write/read).

Thanks in advance.

best regards,
Andreas


-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to define special requirements for an address operand?
  2012-05-25 12:11 ` How to define special requirements for an address operand? Setjem Setjem
@ 2012-05-25 14:03   ` Ian Lance Taylor
  2012-05-25 14:17   ` Georg-Johann Lay
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2012-05-25 14:03 UTC (permalink / raw)
  To: Setjem Setjem; +Cc: gcc-help

"Setjem Setjem" <Setjem@gmx.de> writes:

> I'am trying to write a backend for my own target system.
> The target has two pointer registers but only one of them can be used to read data from memory and the other one to write data into memory.
>
> How could i tell the compiler to use the correct register for the respective operation?
>
> I have tried to copy the address into the correct register in the define_expand "mov<mode>", but this seems to confuse the compiler and not working always.
> I also tried to describe it in the target hook TARGET_LEGITIMATE_ADDRESS_P, but there i have no idea how to find out which operation is performed (write/read).


That target sounds insane.

I think it is going to be quite difficult to get GCC to generate
efficient code with this restriction.  GCC has a basic concept of a
memory address.  It does not separate memory addresses into readable
addresses and writable addresses.  If you write code like a[i]++ GCC is
going to use a single pseudo-register to hold the address to read and
write.  I would not know how to begin fixing that.

Setting aside efficiency considerations, the easy way is going to be to
ignore the write register, and change all your insns that write to
memory to first move the value from the read register to the write
register before doing the actual write.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to define special requirements for an address operand?
  2012-05-25 12:11 ` How to define special requirements for an address operand? Setjem Setjem
  2012-05-25 14:03   ` Ian Lance Taylor
@ 2012-05-25 14:17   ` Georg-Johann Lay
  1 sibling, 0 replies; 3+ messages in thread
From: Georg-Johann Lay @ 2012-05-25 14:17 UTC (permalink / raw)
  To: Andreas Setjem; +Cc: gcc-help

Setjem Setjem wrote:
> Hi, I'am trying to write a backend for my own target system. The target has
> two pointer registers but only one of them can be used to read data from
> memory and the other one to write data into memory.

What will happen if a frame pointer is needed? Is GCC supposed to work with
such a limited hardware at all?

> How could i tell the compiler to use the correct register for the respective
> operation?
> 
> I have tried to copy the address into the correct register in the
> define_expand "mov<mode>", but this seems to confuse the compiler and not
> working always. I also tried to describe it in the target hook
> TARGET_LEGITIMATE_ADDRESS_P, but there i have no idea how to find out which
> operation is performed (write/read).
> 
> Thanks in advance.
> 
> best regards, Andreas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-25 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1337773963.10856.ezmlm@gcc.gnu.org>
2012-05-25 12:11 ` How to define special requirements for an address operand? Setjem Setjem
2012-05-25 14:03   ` Ian Lance Taylor
2012-05-25 14:17   ` Georg-Johann Lay

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).