This is the mail archive of the gcc@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]

Re: Adding new register


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.

Paul


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