From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27610 invoked by alias); 30 Apr 2007 06:35:22 -0000 Received: (qmail 27597 invoked by uid 22791); 30 Apr 2007 06:35:21 -0000 X-Spam-Check-By: sourceware.org Received: from an-out-0708.google.com (HELO an-out-0708.google.com) (209.85.132.249) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Apr 2007 07:35:19 +0100 Received: by an-out-0708.google.com with SMTP id c2so1178781anc for ; Sun, 29 Apr 2007 23:35:18 -0700 (PDT) Received: by 10.100.43.9 with SMTP id q9mr3910127anq.1177914917616; Sun, 29 Apr 2007 23:35:17 -0700 (PDT) Received: by 10.100.44.12 with HTTP; Sun, 29 Apr 2007 23:35:17 -0700 (PDT) Message-ID: <3469ff190704292335h48917831t60e4ed8290247acd@mail.gmail.com> Date: Mon, 30 Apr 2007 08:21:00 -0000 From: "Mark Ewert" To: binutils@sourceware.org Subject: Re: powerpc opcode table checks In-Reply-To: <20070430002358.GA13774@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070420123126.GJ6840@bubble.grove.modra.org> <20070420134011.GK6840@bubble.grove.modra.org> <20070430002358.GA13774@bubble.grove.modra.org> X-IsSubscribed: yes 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: 2007-04/txt/msg00377.txt.bz2 unsubscrube On 4/29/07, Alan Modra wrote: > rlwinm or similar instructions can specify a bitmask rather than the > start and end bits. Of course, the mask can cover all 32 bits. I > don't know what I was thinking to write 0xff. > > opcodes/ > PR 4436 > * ppc-opc.c (powerpc_operands): Correct bitm for second entry of MBE. > gas/ > PR 4436 > * config/tc-ppc.c (ppc_insert_operand): Disable range check if > min > max. > > Index: opcodes/ppc-opc.c > =================================================================== > RCS file: /cvs/src/src/opcodes/ppc-opc.c,v > retrieving revision 1.94 > diff -u -p -r1.94 ppc-opc.c > --- opcodes/ppc-opc.c 21 Apr 2007 05:14:21 -0000 1.94 > +++ opcodes/ppc-opc.c 30 Apr 2007 00:15:52 -0000 > @@ -317,7 +317,7 @@ const struct powerpc_operand powerpc_ope > description in opcode/ppc.h for what this means. */ > #define MBE ME + 1 > { 0x1f, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT }, > - { 0xff, 0, insert_mbe, extract_mbe, 0 }, > + { -1, 0, insert_mbe, extract_mbe, 0 }, > > /* The MB or ME field in an MD or MDS form instruction. The high > bit is wrapped to the low end. */ > Index: gas/config/tc-ppc.c > =================================================================== > RCS file: /cvs/src/src/gas/config/tc-ppc.c,v > retrieving revision 1.119 > diff -u -p -r1.119 tc-ppc.c > --- gas/config/tc-ppc.c 21 Apr 2007 06:54:56 -0000 1.119 > +++ gas/config/tc-ppc.c 30 Apr 2007 00:15:55 -0000 > @@ -1516,7 +1516,7 @@ ppc_insert_operand (insn, operand, val, > { > long min, max, right; > offsetT test; > - > + > max = operand->bitm; > right = max & -max; > min = 0; > @@ -1554,8 +1554,7 @@ ppc_insert_operand (insn, operand, val, > else > test = val; > > - if (test < (offsetT) min > - || test > (offsetT) max > + if ((min <= max && (test < (offsetT) min || test > (offsetT) max)) > || (test & (right - 1)) != 0) > as_bad_value_out_of_range (_("operand"), > test, (offsetT) min, (offsetT) max, file, line); > > -- > Alan Modra > IBM OzLabs - Linux Technology Centre >