From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7110 invoked by alias); 18 Oct 2010 07:48:09 -0000 Received: (qmail 7098 invoked by uid 22791); 18 Oct 2010 07:48:08 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_BJ X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Oct 2010 07:47:58 +0000 Received: by wwe15 with SMTP id 15so18080wwe.12 for ; Mon, 18 Oct 2010 00:47:56 -0700 (PDT) Received: by 10.227.29.102 with SMTP id p38mr3760530wbc.220.1287388076446; Mon, 18 Oct 2010 00:47:56 -0700 (PDT) Received: from richards-desktop.stglab.manchester.uk.ibm.com (gbibp9ph1--blueice2n1.emea.ibm.com [195.212.29.75]) by mx.google.com with ESMTPS id f14sm12019283wbe.2.2010.10.18.00.47.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 18 Oct 2010 00:47:54 -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 1/2] MIPS/GAS: Fix o32 LD to the base register References: Date: Mon, 18 Oct 2010 07:48:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Sun\, 17 Oct 2010 17\:22\:31 +0100 \(BST\)") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (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/msg00280.txt.bz2 "Maciej W. Rozycki" writes: > Here's another one: > > $ cat ld-base.s > ld $4, ($4) > $ mips-linux-as -o ld-base.o ld-base.s > $ mips-linux-objdump -d ld-base.o > > ld-base.o: file format elf32-tradbigmips > > > Disassembly of section .text: > > 00000000 <.text>: > 0: 8c840000 lw a0,0(a0) > 4: 00000000 nop > 8: 8c850004 lw a1,4(a0) > > Ouch! > > Fixed thus and regression tested for mips-linux, mips64-linux, > mipstx39-elf, mipsisa64-elf and mips-ecoff targets and their little-endian > counterparts. The new code produced looks like this: > > $ mips-linux-objdump -d ld-base.o > > ld-base.o: file format elf32-tradbigmips > > > Disassembly of section .text: > > 00000000 <.text>: > 0: 00800821 move at,a0 > 4: 8c240000 lw a0,0(at) > 8: 8c250004 lw a1,4(at) Why are you doing it this way, rather than reversing the loads? Seems a shame to use $at when we don't need to. Richard