This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
setup GCC for new processor EVmicro
- To: <gcc-help at gcc dot gnu dot org>
- Subject: setup GCC for new processor EVmicro
- From: "Bernhard Schaffer" <b dot schaffer at evisioninc dot ch>
- Date: Wed, 24 Oct 2001 13:00:54 +0200
- Reply-To: <b dot schaffer at evisioninc dot ch>
hi !
i am currently trying to port gcc to a new micro controller architecture
and trying to understand the concept of gcc
the micro controller is a 16 bit risc architecture with
separate data and program memory.
it has 16 general purpose registers and
3 data pointer registers with the possibility
to index, increment and decrement.
registers:
r1 - r16: general purpose registers
ap/sp/fp: data pointer registers
64k data memory:
i have the following questions:
a) how should the register classes be defined to get
the highest performance?
- where should framepointer/argpointer/stackpointer
be defined (memory registers or hard registers)
- where should index register be defined ?
b) i have problems to understand the reloading concept
for ap/fp and sp.
- what are the basic functions to control reloading of
the three pointers (concepts in .md *.h )?
- how are the data pointers shared between
ap/fp/sp and index registers
c) i have seen the following error message in my first
compiler version:
---------------------
c file:
void mains()
{
int *p;
*p=5;
}
---------------------
insn:
;; Function mains
(note 2 0 3 "" NOTE_INSN_DELETED)
(note 3 2 4 "" NOTE_INSN_FUNCTION_BEG)
(note 4 3 6 "" NOTE_INSN_DELETED)
(note 6 4 9 0 NOTE_INSN_BLOCK_BEG)
(insn 9 6 11 (set (reg:HI 25)
(mem/f:HI (plus:HI (reg:HI 21)
(const_int -2 [0xfffffffe])) 0)) -1 (nil)
(nil))
(insn 11 9 12 (set (reg:HI 26)
(const_int 5 [0x5])) -1 (nil)
(nil))
(insn 12 11 14 (set (mem:HI (reg:HI 25) 0)
(reg:HI 26)) -1 (nil)
(nil))
(note 14 12 15 0 NOTE_INSN_BLOCK_END)
(note 15 14 17 "" NOTE_INSN_FUNCTION_END)
(code_label 17 15 0 2 "" [num uses: 0])
-----------------------
error:
cpp: -lang-c: linker input file unused since linking not done
main_pointer.c: In function `mains':
main_pointer.c:54: fixed or forbidden register 16 (ap) was spilled for class
IND
EX_REGS.
main_pointer.c:54: This may be due to a compiler bug or to impossible asm
main_pointer.c:54: statements or clauses.
main_pointer.c:54: This is the instruction:
(insn 12 11 14 (set (mem:HI (reg:HI 1 r2) 0)
(reg:HI 2 r3)) 2 {*movhi} (nil)
(nil))
-------------------------
reloading of (reg:HI 25) comes to a general purpose
register r2 which is wrong.
how can the reloading of (reg:HI 25) be
controlled to end up in a data pointer ?
thank you very much for your help.
Bernhard Schaffer