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

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)

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
set. > > GCC will feed any memory accesses through this function to see if they > are directly supported, and if not it will break them up into > something smaller and try again. > > Hope that helps, > > -- Michael > > > 2010/1/26 Sergio Ruocco : >> Gabriel Pa

Re: porting GCC to a micro with a very limited addressing mode --- success with LEGITIMATE / LEGITIMIZE_ADDRESS, stuck with ICE !

2010-02-09 Thread Sergio Ruocco
811 } Could it be the REG+OFF which the LEGITIMATE_ADDRESS() rejects above? But then why all the others before it get re-written by a call to LEGITIMIZE_ ADDRESS() ?! What is calling change_address_1() at the end of the compilation phase? Thanks Sergio ======

Re: porting GCC to a micro with a very limited addressing mode --- enforcing a 'register indirect memory operand' through a constraint in md

2010-02-10 Thread Sergio Ruocco
rtx x, >bool strict_checking) > { > /* (mem reg) */ > if (REG_P (x) > && _reg_ok (x, strict_checking) > ) > { > return 1; > } > > return 0; > } > > Note that this ISA only has indirect addres

Re: porting GCC to a micro with a very limited addressing mode --- enforcing a 'register indirect memory operand' through a constraint in md

2010-02-10 Thread Sergio Ruocco
s_constant(stack_pointer_rtx,-4)),hard_frame_pointer_rtx); ... } Sergio Ruocco wrote: > > Thanks Micheal for your code, I will try it... however, I think the > problem that crashes my compiler may not lie in my LEGITIMATE/LEGITIMIZE > ADDRESS macros, which are equivalent to many others (

Re: GCC porting tutorials

2010-04-24 Thread Sergio Ruocco
Hi Radu, Check both the GCC Wiki and the work done at IIT Bombay: http://www.cse.iitb.ac.in/grc/reach.html Activities->Workshops They developed some tutorials on porting GCC and writing new backends, such as: http://www.cse.iitb.ac.in/grc/gcc-workshop-09/ http://www.cse.iitb.ac.in/~uday/gcc-mini-

Trouble with MDs: "const" RTL object stops recognition of RTL expressions by insn patterns

2010-05-25 Thread Sergio Ruocco
Dear All, I am porting GCC to a 16 bit micro (with 16 bit bytes, thus BITS_PER_UNIT=16, 16 bit ints become "QI"s etc). The port compiles is nearly done and simple C programs, but now chokes on a trivial line such as: yyy(&array[4], &e, &p); with this error: xxx.c: In function ‘yyy’: x