From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10337 invoked by alias); 10 Oct 2010 10:19:21 -0000 Received: (qmail 10326 invoked by uid 22791); 10 Oct 2010 10:19:20 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 10 Oct 2010 10:19:16 +0000 Received: by wyb40 with SMTP id 40so320877wyb.0 for ; Sun, 10 Oct 2010 03:19:14 -0700 (PDT) Received: by 10.227.141.132 with SMTP id m4mr4601447wbu.65.1286705953881; Sun, 10 Oct 2010 03:19:13 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk [82.133.89.107]) by mx.google.com with ESMTPS id g9sm4873040wbh.19.2010.10.10.03.19.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 10 Oct 2010 03:19:13 -0700 (PDT) From: Richard Sandiford To: "Maciej W. Rozycki" Mail-Followup-To: "Maciej W. Rozycki" ,binutils@sourceware.org, rdsandiford@googlemail.com Cc: binutils@sourceware.org Subject: Re: [PATCH 14/15] MIPS/GAS/test: Run the LD test with forward references References: Date: Sun, 10 Oct 2010 10:19:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Sun, 3 Oct 2010 20:41:14 +0100 (BST)") Message-ID: <87bp72l59c.fsf@firetop.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2010-10/txt/msg00138.txt.bz2 "Maciej W. Rozycki" writes: > Note this has revealed a deficiency in our relaxation code. In theory > the machine code generated from a single piece of assembly source should > be the same regardless of whether any data objects referenced have been > provided before the respective references or after. This is not the case. > A couple of unnecesary load-delay NOPs are output for platforms that have > load-delay slots. > > The reason for this is the load-delay slot dependency is only checked > against the first relaxation variant and any requirements are fulfilled by > appending these NOPs (or one only, as other cases such as HI/LO > dependencies do not apply here) to the code before the variant frag, > rather then the relaxed sequence itself. If in the end the second variant > is chosen then the stray NOP remains. > > Any particular reason we take this approach these days? I understand > with the old relaxation code resolving such things was somewhat tricky if > possible at all, but I see no reason for the extra NOP to be emitted to > the variant frags as a need arises these days. In no case it would seem > the dependency would cross beyond a variant frag to any code that follows > so no need to fear choosing the second variant would cause any NOPs to be > missing to satisfy code after the frag it would seem (to me anyway). No particular reason, no. It just wasn't part of the motivation for the original relaxation changes. Improving the quality of MIPS I code is always very low down the priority list. > 2010-10-03 Maciej W. Rozycki > > gas/testsuite/ > * gas/mips/ld.s: Adjust to let data objects be only > defined/declared (as appropriate) at the end of assembly, based > on the presence or not of the "forward" symbol. > * gas/mips/ld-f.d: New test. > * gas/mips/mips1@ld-f.d: Likewise. MIPS I version. > * gas/mips/r3000@ld-f.d: Likewise, R3000 version. > * gas/mips/ecoff@ld-f.d: Likewise, ECOFF version. > * gas/mips/r3900@ecoff@ld-f.d: Likewise, R3900/ECOFF version. > * gas/mips/mips2@ecoff@ld-f.d: Likewise, MIPS II/ECOFF version. > * gas/mips/mips32@ecoff@ld-f.d: Likewise, MIPS32/ECOFF version. > * gas/mips/mips32r2@ecoff@ld-f.d: Likewise, MIPS32r2/ECOFF > version. > * gas/mips/ld-n32-f.d: New test. > * gas/mips/ld-n64-f.d: Likewise. > * gas/mips/mips.exp: Run the new tests. Let's use "-forward" rather than "-f", for consistency with the symbol name and to avoid any possible confusion with "floating point". OK otherwise, thanks. Richard