From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56919 invoked by alias); 23 Dec 2016 21:15:45 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 56280 invoked by uid 89); 23 Dec 2016 21:15:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=iva, SPECIAL, MIPS64, Field X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Dec 2016 21:15:43 +0000 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id AC6CEB08D5822 for ; Fri, 23 Dec 2016 21:15:36 +0000 (GMT) Received: from [10.20.78.37] (10.20.78.37) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.294.0; Fri, 23 Dec 2016 21:15:39 +0000 Date: Fri, 23 Dec 2016 21:15:00 -0000 From: "Maciej W. Rozycki" To: Subject: [committed] MIPS16: Remove "extended" BREAK/SDBBP handling Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2016-12/txt/msg00403.txt.bz2 Remove special casing for the `6' operand code used for the embedded trap code of the BREAK and the SDBBP instructions to support supposedly extended forms of these instructions. According to all versions of the MIPS16 ASE specifications these instructions are not extensible [1][2][3][4][5][7][8][10][11], and as from revision 2.50 of the MIPS16e ASE specifications it has been further clarified what was previously implied, that non-extesiable instructions when preceded with an EXTEND prefix must cause a Reserved Instruction exception [5][6][9][10]. Therefore supposedly extended BREAK and SDBBP instructions do not serve their purpose anymore as they do not cause a Bp and a Debug exception respectively and supporting these forms in disassembly only causes confusion. References: [1] "Product Description, MIPS16 Application-Specific Extension", Version 1.3, MIPS Technologies, Inc., 970130, Table 3. "MIPS16 Instruction Set Summary", p. 5 [2] same, Table 5 "RR Minor Opcodes (RR-type instructions)", p.10 [3] same, Table 18. "Extendable MIPS16 Instructions", p. 24 [4] "MIPS32 Architecture for Programmers, Volume IV-a: The MIPS16e Application-Specific Extension to the MIPS32 Architecture", MIPS Technologies, Inc., Document Number: MD00076, Revision 2.63, July 16, 2013, Table 3.8 "MIPS16e Special Instructions", p. 38 [5] same, Section 3.11 "MIPS16e Extensible Instructions, p. 41 [6] same, Table 3.15 "MIPS16e Extensible Instructions", p. 41 [7] same, Table 3.24 "MIPS16e RR Encoding of the Funct Field", p. 49 [8] "MIPS64 Architecture for Programmers, Volume IV-a: The MIPS16e Application-Specific Extension to the MIPS64 Architecture", MIPS Technologies, Inc., Document Number: MD00077, Revision 2.60, June 25, 2008, Table 1.8 "MIPS16e Special Instructions", p. 39 [9] same, Section 1.11 "MIPS16e Extensible Instructions", p. 42 [10] same, Table 1.15 "MIPS16e Extensible Instructions", pp. 42-43 [11] same, Table 1.24 "MIPS16e RR Encoding of the Funct Field", p. 50 gas/ * config/tc-mips.c (match_mips16_insn): Remove the `6' operand code special case and its associated comment. opcodes/ * mips16-opc.c (decode_mips16_operand) <'6'>: Remove extended encoding support. --- binutils-mips16-opcode-format-6.diff Index: binutils/gas/config/tc-mips.c =================================================================== --- binutils.orig/gas/config/tc-mips.c 2016-12-16 01:00:34.865811996 +0000 +++ binutils/gas/config/tc-mips.c 2016-12-16 03:31:53.423098944 +0000 @@ -8188,14 +8188,7 @@ match_mips16_insn (struct mips_cl_insn * if (!operand) abort (); - /* '6' is a special case. It is used for BREAK and SDBBP, - whose operands are only meaningful to the software that decodes - them. This means that there is no architectural reason why - they cannot be prefixed by EXTEND, but in practice, - exception handlers will only look at the instruction - itself. We therefore allow '6' to be extended when - disassembling but not when assembling. */ - if (operand->type != OP_PCREL && c != '6') + if (operand->type != OP_PCREL) { ext_operand = decode_mips16_operand (c, TRUE); if (operand != ext_operand) Index: binutils/opcodes/mips16-opc.c =================================================================== --- binutils.orig/opcodes/mips16-opc.c 2016-12-16 01:00:34.964660479 +0000 +++ binutils/opcodes/mips16-opc.c 2016-12-16 03:31:53.509611972 +0000 @@ -50,6 +50,7 @@ decode_mips16_operand (char type, bfd_bo switch (type) { case '0': MAPPED_REG (0, 0, GP, reg_0_map); + case '6': UINT (6, 5); case 'L': SPECIAL (6, 5, ENTRY_EXIT_LIST); case 'M': SPECIAL (7, 0, SAVE_RESTORE_LIST); @@ -81,7 +82,6 @@ decode_mips16_operand (char type, bfd_bo case '4': SINT (15, 0); case '5': SINT (16, 0); - case '6': SINT (16, 0); case '8': SINT (16, 0); case 'A': PCREL (16, 0, TRUE, 0, 2, FALSE, FALSE); @@ -109,7 +109,6 @@ decode_mips16_operand (char type, bfd_bo case '4': SINT (4, 0); case '5': UINT (5, 0); - case '6': UINT (6, 5); case '8': UINT (8, 0); case 'A': PCREL (8, 0, FALSE, 2, 2, FALSE, FALSE);