From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26219 invoked by alias); 28 Apr 2006 11:43:21 -0000 Received: (qmail 25903 invoked by uid 22791); 28 Apr 2006 11:43:18 -0000 X-Spam-Check-By: sourceware.org Received: from bender.bawue.de (HELO bender.bawue.de) (193.7.176.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 28 Apr 2006 11:43:12 +0000 Received: from lagash (unknown [194.74.144.146]) by bender.bawue.de (Postfix) with ESMTP id 54AF4442C0 for ; Fri, 28 Apr 2006 13:43:09 +0200 (MEST) Received: from ths by lagash with local (Exim 4.61) (envelope-from ) id 1FZRMj-0000le-V4 for binutils@sourceware.org; Fri, 28 Apr 2006 12:42:29 +0100 Date: Fri, 28 Apr 2006 13:23:00 -0000 To: binutils@sourceware.org Subject: [PATCH] Use O32 mapping for MIPS16 register names Message-ID: <20060428114229.GD4579@networkno.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11+cvs20060403 From: Thiemo Seufer X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00409.txt.bz2 Hello All, I applied the appended patch, it accounts for the gpr-names option handling for MIPS16. Thiemo 2006-04-28 Thiemo Seufer Nigel Stevens * opcodes/mips-dis.c (mips16_to_32_reg_map, mips16_reg_names): Map MIPS16 registers to O32 names. (print_mips16_insn_arg): Use mips16_reg_names. Index: opcodes/mips-dis.c =================================================================== RCS file: /cvs/src/src/opcodes/mips-dis.c,v retrieving revision 1.55 diff -u -p -r1.55 mips-dis.c --- opcodes/mips-dis.c 14 Nov 2005 02:25:39 -0000 1.55 +++ opcodes/mips-dis.c 27 Apr 2006 12:53:39 -0000 @@ -51,12 +51,15 @@ struct mips_cp0sel_name const char * const name; }; -/* The mips16 register names. */ -static const char * const mips16_reg_names[] = +/* The mips16 registers. */ +static const unsigned int mips16_to_32_reg_map[] = { - "s0", "s1", "v0", "v1", "a0", "a1", "a2", "a3" + 16, 17, 2, 3, 4, 5, 6, 7 }; +#define mips16_reg_names(rn) mips_gpr_names[mips16_to_32_reg_map[rn]] + + static const char * const mips_gpr_names_numeric[32] = { "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7", @@ -1283,27 +1316,27 @@ print_mips16_insn_arg (char type, case 'y': case 'w': (*info->fprintf_func) (info->stream, "%s", - mips16_reg_names[((l >> MIPS16OP_SH_RY) - & MIPS16OP_MASK_RY)]); + mips16_reg_names(((l >> MIPS16OP_SH_RY) + & MIPS16OP_MASK_RY))); break; case 'x': case 'v': (*info->fprintf_func) (info->stream, "%s", - mips16_reg_names[((l >> MIPS16OP_SH_RX) - & MIPS16OP_MASK_RX)]); + mips16_reg_names(((l >> MIPS16OP_SH_RX) + & MIPS16OP_MASK_RX))); break; case 'z': (*info->fprintf_func) (info->stream, "%s", - mips16_reg_names[((l >> MIPS16OP_SH_RZ) - & MIPS16OP_MASK_RZ)]); + mips16_reg_names(((l >> MIPS16OP_SH_RZ) + & MIPS16OP_MASK_RZ))); break; case 'Z': (*info->fprintf_func) (info->stream, "%s", - mips16_reg_names[((l >> MIPS16OP_SH_MOVE32Z) - & MIPS16OP_MASK_MOVE32Z)]); + mips16_reg_names(((l >> MIPS16OP_SH_MOVE32Z) + & MIPS16OP_MASK_MOVE32Z))); break; case '0':