This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] microMIPS support
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Sat, 19 May 2012 00:53:27 +0100
- Subject: Re: [PATCH] microMIPS support
- References: <alpine.DEB.1.10.1204241843340.19835@tp.orcam.me.uk> <20120426183713.GA21029@host2.jankratochvil.net> <alpine.DEB.1.10.1204261954270.19835@tp.orcam.me.uk>
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