[RFA] MIPS: Introduce struct mips_regnums and accessors

Andrew Cagney ac131313@redhat.com
Wed May 21 19:39:00 GMT 2003


Kevin,

I think the struct contains too many redudnant fields.  Instead it can 
be be trimmed back to identify just the boundaries between the different 
register groups vis:

- gp0 (gp31?)
- fp0
- hi, lo
- pc
- various status registers
- others?

As for assigning meaning to specific registers (v0, a0, ...) within a 
group, offsets can be used vis:

	v0_regnum (regnums) === regnums->gp0 + offset;

With regard to having only 16 o32 FP registers, is that right?  Does it 
just confuse things?  Doesn't the o32 debug info assume a bank of 32 
contigious 32 bit registers?  A location expression for a double in 
``f0'' would be f0:f1 for instance.

Andrew


> +/* MIPS register numbers.  */
> +struct mips_regnums
> +  {
> +    int zero_regnum;		/* The zero register; read-only, always 0.  */
> +    int v0_regnum;		/* Function return value.  */
> +    int a0_regnum;		/* First GPR used for passing arguments.  */
> +    int t9_regnum;		/* Contains address of callee in PIC code.  */
> +    int sp_regnum;		/* Stack pointer.  */
> +    int ra_regnum;		/* Return address.  */
> +    int ps_regnum;		/* Processor status.  */
> +    int hi_regnum;		/* High portion of internal multiply/divide
> +				   register.  */
> +    int lo_regnum;		/* Low portion of internal multiply/divide
> +    				   register.  */
> +    int badvaddr_regnum;	/* Address associated with
> +    				   addressing exception.  */
> +    int cause_regnum;		/* Describes last exception.  */
> +    int pc_regnum;		/* Program counter.  */
> +    int fcrcs_regnum;		/* FP control/status.  */
> +    int fcrir_regnum;		/* FP implementation/revision.  */
> +    int fp0_regnum;		/* First floating point register.  */
> +    int fplast_regnum;		/* Last floating point register.  */
> +    int fpa0_regnum;		/* First floating point register used for
> +    				   passing floating point arguments.  */
> +    int first_embed_regnum;	/* First CP0 register for embedded use.  */
> +    int last_embed_regnum;	/* Last CP0 register for embedded use.  */
> +    int prid_regnum;		/* Processor ID.  */
> +
> +    int last_arg_regnum;	/* Last general purpose register used for
> +    				   passing arguments.  (a0_regnum is the
> +				   first.)  */
> +    int last_fp_arg_regnum;	/* Last floating point register used for
> +    				   passing floating point arguments.  */
> +  };




More information about the Gdb-patches mailing list