From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31323 invoked by alias); 4 Jul 2011 20:30:41 -0000 Received: (qmail 31313 invoked by uid 22791); 4 Jul 2011 20:30:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW 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; Mon, 04 Jul 2011 20:30:25 +0000 Received: by wyg36 with SMTP id 36so4431097wyg.0 for ; Mon, 04 Jul 2011 13:30:23 -0700 (PDT) Received: by 10.227.173.66 with SMTP id o2mr5697805wbz.17.1309811423619; Mon, 04 Jul 2011 13:30:23 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk [82.133.89.107]) by mx.google.com with ESMTPS id gb1sm4753251wbb.54.2011.07.04.13.30.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jul 2011 13:30:22 -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] MIPS/GAS: Fix DWARF-2 with branch swapping for MIPS16 code References: <87boxg5nyo.fsf@firetop.home> <87boxdcf2b.fsf@firetop.home> Date: Mon, 04 Jul 2011 22:20:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Mon, 4 Jul 2011 20:34:53 +0100 (BST)") Message-ID: <87ei254wmb.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: 2011-07/txt/msg00044.txt.bz2 "Maciej W. Rozycki" writes: > BTW, I've been wondering about this construct: > > return mask & ~0; > > you've introduced in a couple of places. Oops. Fixed below. > Also why "can not" instead of "cannot"? My understanding of the > subtleties of English is this essentially means we "are allowed not to > swap" rather than we "are not allowed to swap". The usual disclaimer > applies of course. ;) Those comments were already there. I just moved them around. > Finally I think the change below is needed as well. We shouldn't be > relying on the meaning of FP_D for MIPS16 code as opcode flags are assumed > to have a different meaning in the MIPS16 table. Granted, the location of > the FP_D bit hasn't been assigned to anything (yet), so it's guaranteed to > be zero and the check is harmless, Yes. I checked that before writing it this way. It's guaranteed to be harmless anyway, because "until" MIPS16 gets hardware FP support, we'd never have any set bits. I structured the code to be consistent with the GPR case. If you feel strongly about it though, feel free to move the conditions inside the existing "!mips_opts.mips16" check. Richard gas/ * config/tc-mips.c (gpr_read_mask, gpr_write_mask): Fix handling of register 0. Index: gas/config/tc-mips.c =================================================================== --- gas/config/tc-mips.c 2011-07-04 21:00:54.000000000 +0100 +++ gas/config/tc-mips.c 2011-07-04 21:01:13.000000000 +0100 @@ -2450,7 +2450,8 @@ gpr_read_mask (const struct mips_cl_insn if (pinfo2 & INSN2_READ_GPR_Z) mask |= 1 << EXTRACT_OPERAND (RZ, *ip); } - return mask & ~0; + /* Don't include register 0. */ + return mask & ~1; } /* Return the mask of core registers that IP writes. */ @@ -2492,7 +2493,8 @@ gpr_write_mask (const struct mips_cl_ins if (pinfo2 & INSN2_WRITE_GPR_Z) mask |= 1 << EXTRACT_OPERAND (RZ, *ip); } - return mask & ~0; + /* Don't include register 0. */ + return mask & ~1; } /* Return the mask of floating-point registers that IP reads. */