This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH] microMIPS support


On Thu, 26 Apr 2012, Maciej W. Rozycki wrote:

> > > @@ -686,8 +779,8 @@ mips_ax_pseudo_register_push_stack (stru
> > >    return 0;
> > >  }
> > >  
> > > -/* Table to translate MIPS16 register field to actual register number.  */
> > > -static int mips16_to_32_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
> > > +/* Table to translate 3-bit register field to actual register number.  */
> > > +static int mips_reg3_to_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
> > 
> > It can be const.
> 
>  One change at a time.
> 
>  This lookup can also be transformed into a simple 
> three-assembly-instruction calculation, but it's called in enough places 
> that I think it's cheaper in the current form.  But for this to stand this 
> table should also be of the "unsigned char" type.

 I have applied the change below now too.

  Maciej

2012-05-18  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/
	* mips-tdep.c (mips_reg3_to_reg): Optimize storage.

gdb-mips-reg3.diff
Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.c	2012-04-27 19:05:14.000000000 +0100
+++ gdb-fsf-trunk-quilt/gdb/mips-tdep.c	2012-04-27 19:34:09.795560276 +0100
@@ -781,7 +781,7 @@ mips_ax_pseudo_register_push_stack (stru
 }
 
 /* Table to translate 3-bit register field to actual register number.  */
-static int mips_reg3_to_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
+static const signed char mips_reg3_to_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
 
 /* Heuristic_proc_start may hunt through the text section for a long
    time across a 2400 baud serial line.  Allows the user to limit this


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