Stelian Pop wrote:
> Hi,
> 
> I'm (still) porting GCC to a 16 bit microcontroller, and I'm having a few
> issues with the way it handles memory accesses: this microcontroller can
> function in two modes: in one of them the pointers are on 16 bit (a full
> register), in the second one the pointers are on 32 bit and are stored in
> two following registers (N and N+1).
> 
> I did implement a GCC option to select between the two modes, and I'm using
> this option to select the size of the pointers and Pmode:
> 
> #define Pmode         ((TARGET_16) ? HImode : SImode) #define POINTER_SIZE
> ((TARGET_16) ? 16 : 32)
> 
> Do I need to define movsi3(), addsi3() etc. patterns manually or should GCC
> figure those by itself ?

  Not sure I understand you.  You always need to define movMM3 etc.  GCC will
correctly select between movhi3 and movsi3 based on your Pmode macro when
handling pointers, but you still need to write the patterns.

> Is there something special I need to do to express the relationship between
> the two registers N and N+1 composing a pointer, or does GCC automatically
> allocate two subsequent HI registers when it needs a SI one ?

  GCC always uses consecutive hard regs when doing multi-reg data sizes.  See
HARD_REGNO_MODE_OK in the internals docs.

    cheers,
      DaveK

Reply via email to