This is the mail archive of the
mailing list for the GCC project.
Re: Adding new register
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: "Petar Penchev" <ptr at melexis dot com>,"gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 6 Jan 2005 13:35:12 +0000
- Subject: Re: Adding new register
- Organization: CodeSourcery
- References: <email@example.com>
On Thursday 06 January 2005 06:52, Petar Penchev wrote:
> Hello All,
> The GCC port I am working on now supports two versions of a same CPU core.
> The differences were only few instructions.
> Then a new regoster had been added to the second version of CPU. The main
> problem is that this register is 40 bits wide and th CPU has PUSH and
> POP instructions for it, as well as some move instructions. It is also
> availible in 32,16 and 8 bit mode, however PUSH / POP instructions store /
> load 40 bits. I in defined my_target-modes.def new mode EDI with
> following line
> INT_MODE(EDI,5);. I have defined 'pushedi' and 'popedi' patterns but I
> still cann't make GCC to push/pop this register. GCC uses it as a one
> level stack.
> What else should I do to make GCC to store/load this 40 bit register
> to/from stack ?
You way want to look at how other ports generate function epilogue and
prologue. For example the Arm port uses special instructions to save/restore
floating point registers in their raw format.
N.B. The arm port still uses text epilogues, so may not be a good example. The
prologue is correctly generated as RTL though.