This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

comprehensive porting howto...


Hi,

I'm looking for some advice on the steps to take
to port gcc for a homemade risc 16bit controller.

`Using and Porting GNU CC' is the reference for this, and 
`porting gcc for dunces' by H.P.Nilsson is quite useful too. 

However I lack the `howto' (what is absolutely required at first, what
comes after when foundations are ok). They do not help to split the
process in elementary (partially useable and checkable) steps. It
seems like you have to work in the blind for two weeks then face all
bugs at once ;-)

I'm taking as a basis Matsushita MN10200 risc that looks a bit like
mine, excepted the fact that MN10200 does not seem to have a dedicated
stack register (no push/pop instruction) and makes subtleties when
handling pointers to single integers (PSImode).

I can isolate simple concepts like

- checking the ALU is ok with registers by introducing define_insn one
  by one in .md, in SImode, then HImode, then BImode,...
- checking the most basic function passes registers properly
- introducing use of the stack, prologues and epilogues
- handling base pointers (available only for load) and indexing (not available
  or at the price of a big fat multiplication involving three regs) 
  is still a dark area for me 
- having the recognition of neighbour memory areas ok (If 
  a3=0x2341, and you want to load [0x2348], better to go for [a3+7])
- optimization: good idea, but clumsy correct assembly would be great at first

- gdb/dwarf: not a priority
- profiling: not a priority 
- trampoline: I do not use this kind of things

I also have to introduce a `nop' in some defined cases of pipeline hazard,
looking a lot like the `fixing' code of delayed branches but in a very
simple case.

Paradoxally code generated with -O2 seems more clear than the -O0
code which spends a lot of instructions in moving x->y then y->x etc ;-)

Hoping for some mentoring, in the sense of: what should I do _first_.

Sincerely yours,

-- 
Emmanuel Michon
Chef de projet
REALmagic France SAS
Mobile: 0614372733 GPGkeyID: D2997E42  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]