Re: How to define special requirements for an address operand?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Setjem Setjem" <Setjem@xxxxxx> 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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux