From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113181 invoked by alias); 15 Apr 2017 23:44:31 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 113147 invoked by uid 89); 15 Apr 2017 23:44:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:Sun, simulator, Simulator 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; Sat, 15 Apr 2017 23:44:29 +0000 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id C955320E248A0; Sun, 16 Apr 2017 00:44:23 +0100 (IST) Received: from [10.20.78.105] (10.20.78.105) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.294.0; Sun, 16 Apr 2017 00:44:27 +0100 Date: Sat, 15 Apr 2017 23:44:00 -0000 From: "Maciej W. Rozycki" To: Joel Sherrill CC: "gdb@sourceware.org" Subject: Re: Help Translating Message from MIPS Simulator In-Reply-To: <1a3390f5-6456-d8bf-45b9-872c8be24a83@oarcorp.com> Message-ID: References: <1a3390f5-6456-d8bf-45b9-872c8be24a83@oarcorp.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2017-04/txt/msg00018.txt.bz2 On Sun, 16 Apr 2017, Joel Sherrill wrote: > We have some RTEMS tests failing on the mips simulator > in gdb. We are using the jmr3904 configuration and the > run ends with this message: > > HILO: MFHI: MF at 0x88015698 following OP at 0x88000464 corrupted by MT at > 0x88003c68 > > 0x88000464 does appear to be in a reasonable location > inside the test. > > How do I translate the rest to get an idea about the fault? I'll give some background information. In MIPS architecture HILO or HI/LO is the integer multiply-divide (MD) unit's accumulator aka the HI and LO register pair. For widening multiplication LO holds the low part of the product and HI holds the corresponding high part. For division LO holds the quotient and HI holds the remainder. These registers are not a part of the general ALU and therefore special operations have been defined to retrieve and also to store data there: MFHI and MFLO (Move From HI/LO) are the read instructions and MTHI and MTLO (Move To HI/LO) are the write instructions for the HI and the LO register respectively. In older architecture revisions the MTHI and MTLO instructions are only really useful for context switches as data placed there cannot be further used, except to read it back with MFHI or MFLO. Consequently MTHI and MTLO are seldom used and those architecture revisions do not have hardware interlocks implemented for them, requiring a sufficient number of other instructions to be executed between a MFHI or MFLO and a following MTHI or MTLO for predictable results to be produced. Otherwise the MTHI/MTLO operation may (and generally will) corrupt data retrieved with MFHI/MFLO. NB later architecture revisions have integer multiply-accumulate instructions which use HI/LO as one of inputs, making MTHI and MTLO more useful, and they do implement hardware interlocks for them. So the message above means that the result of a MFHI or MFLO operation (MF) at 0x88015698 executed after an MD unit operation (OP) at 0x88000464 has been corrupted by a MTHI or MTLO operation (MT) at 0x88003c68. And I believe that what I wrote above makes the HILO and MFHI prefixes obvious. HTH, Maciej