From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8080 invoked by alias); 16 Feb 2005 18:01:40 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 8029 invoked from network); 16 Feb 2005 18:01:36 -0000 Received: from unknown (HELO pollux.ds.pg.gda.pl) (153.19.208.7) by sourceware.org with SMTP; 16 Feb 2005 18:01:36 -0000 Received: from localhost (localhost [127.0.0.1]) by pollux.ds.pg.gda.pl (Postfix) with ESMTP id F0587F598D; Wed, 16 Feb 2005 19:01:30 +0100 (CET) Received: from pollux.ds.pg.gda.pl ([127.0.0.1]) by localhost (pollux [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25304-07; Wed, 16 Feb 2005 19:01:30 +0100 (CET) Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8]) by pollux.ds.pg.gda.pl (Postfix) with ESMTP id A752BF5980; Wed, 16 Feb 2005 19:01:30 +0100 (CET) Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6]) by piorun.ds.pg.gda.pl (8.13.1/8.13.1) with ESMTP id j1GI1Ycr026174; Wed, 16 Feb 2005 19:01:35 +0100 Date: Thu, 17 Feb 2005 00:25:00 -0000 From: "Maciej W. Rozycki" To: Thiemo Seufer Cc: binutils@sources.redhat.com Subject: Re: [PATCH] MIPS gas: Fix macro expansions for .set noat In-Reply-To: <20050216154924.GG1757@rembrandt.csv.ica.uni-stuttgart.de> Message-ID: References: <20050216154924.GG1757@rembrandt.csv.ica.uni-stuttgart.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Status: Clean X-SW-Source: 2005-02/txt/msg00377.txt.bz2 On Wed, 16 Feb 2005, Thiemo Seufer wrote: > @@ -5762,11 +5761,19 @@ macro (struct mips_cl_insn *ip) > case M_LWU_AB: > s = "lwu"; > ld: > - if (breg == treg || coproc || lr) > + /* XXX Why don't we try to use AT for all expansions? */ Because we don't have to and it helps in cases like: .set noat ld k0,foo > + if (!mips_opts.noat && (breg == treg || coproc || lr)) > { > tempreg = AT; > used_at = 1; > } > + else if (breg == treg > + && (offset_expr.X_op != O_constant > + || (offset_expr.X_add_number > 0x7fff > + || offset_expr.X_add_number < -0x8000))) > + { > + as_bad(_("load expansion needs $at register")); > + } > else > { > tempreg = treg; This looks broken -- you can only use treg as a scratch pad if it's a GPR. > @@ -5840,8 +5847,23 @@ macro (struct mips_cl_insn *ip) > case M_SDR_AB: > s = "sdr"; > st: > - tempreg = AT; > - used_at = 1; > + if (!mips_opts.noat) > + { > + tempreg = AT; > + used_at = 1; > + } > + else if (breg == treg > + && (offset_expr.X_op != O_constant > + || (offset_expr.X_add_number > 0x7fff > + || offset_expr.X_add_number < -0x8000))) > + { > + as_bad(_("store expansion needs $at register")); > + } > + else > + { > + tempreg = treg; > + used_at = 0; > + } > ld_st: > /* Itbl support may require additional care here. */ > if (mask == M_LWC1_AB This is yet more broken -- treg can never be used, because it contains the value to be stored! And of course it's not expected to get trashed anyway. Maciej