From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8007 invoked by alias); 18 May 2012 23:53:52 -0000 Received: (qmail 7994 invoked by uid 22791); 18 May 2012 23:53:51 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 May 2012 23:53:39 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SVWzK-0003UU-Gp from Maciej_Rozycki@mentor.com ; Fri, 18 May 2012 16:53:38 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 18 May 2012 16:53:38 -0700 Received: from [172.30.1.131] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Sat, 19 May 2012 00:53:35 +0100 Date: Fri, 18 May 2012 23:53:00 -0000 From: "Maciej W. Rozycki" To: Jan Kratochvil CC: Subject: Re: [PATCH] microMIPS support In-Reply-To: Message-ID: References: <20120426183713.GA21029@host2.jankratochvil.net> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00725.txt.bz2 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 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