Re: porting GCC to a micro with a very limited addressing mode --- what to write in LEGITIMATE_ADDRESS, LEGITIMIZE_ADDRESS and micro.md ?!

2010-01-28 Thread Sergio Ruocco
Now my GO_IF_LEGITIMATE_ADDRESS refuses anything that is not a REG or a CONSTANT_ADDRESS: int legitimate_address1(enum machine_mode MODE,rtx X) { if(CONSTANT_ADDRESS_P(X)) return 1; if(GET_CODE(X)==REG && is_base_reg(REGNO(X))) return 1; r

Re: porting GCC to a micro with a very limited addressing mode --- what to write in LEGITIMATE_ADDRESS, LEGITIMIZE_ADDRESS and micro.md ?!

2010-01-25 Thread Michael Hope
Hi Sergio. My port has similar addressing modes - all memory must be accessed by one of two registers and can only be accessed indirectly, indirect with pre increment, and indirect with post increment. The key is GO_IF_LEGITIMATE_ADDRESS and the legitimate address helper function. Mine looks lik

Re: porting GCC to a micro with a very limited addressing mode --- what to write in LEGITIMATE_ADDRESS, LEGITIMIZE_ADDRESS and micro.md ?!

2010-01-25 Thread Jeff Law
On 01/25/10 11:21, Sergio Ruocco wrote: Gabriel Paubert wrote: On Mon, Jan 25, 2010 at 01:34:09PM +0100, Sergio Ruocco wrote: Hi everyone, I am porting GCC to a custom 16-bit microcontroller with very limited addressing modes. Basically, it can only load/store using a (general purpos

Re: porting GCC to a micro with a very limited addressing mode --- what to write in LEGITIMATE_ADDRESS, LEGITIMIZE_ADDRESS and micro.md ?!

2010-01-25 Thread Sergio Ruocco
Gabriel Paubert wrote: > On Mon, Jan 25, 2010 at 01:34:09PM +0100, Sergio Ruocco wrote: >> Hi everyone, >> >> I am porting GCC to a custom 16-bit microcontroller with very limited >> addressing modes. Basically, it can only load/store using a (general >> purpose) register as the address, without an

Re: porting GCC to a micro with a very limited addressing mode --- what to write in LEGITIMATE_ADDRESS, LEGITIMIZE_ADDRESS and micro.md ?!

2010-01-25 Thread Gabriel Paubert
On Mon, Jan 25, 2010 at 01:34:09PM +0100, Sergio Ruocco wrote: > > Hi everyone, > > I am porting GCC to a custom 16-bit microcontroller with very limited > addressing modes. Basically, it can only load/store using a (general > purpose) register as the address, without any offset: > > LOAD

porting GCC to a micro with a very limited addressing mode --- what to write in LEGITIMATE_ADDRESS, LEGITIMIZE_ADDRESS and micro.md ?!

2010-01-25 Thread Sergio Ruocco
Hi everyone, I am porting GCC to a custom 16-bit microcontroller with very limited addressing modes. Basically, it can only load/store using a (general purpose) register as the address, without any offset: LOAD (R2) R1; load R1 from memory at address (R2) STORE R1 (R2) ; st