From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15022 invoked by alias); 30 Apr 2007 00:24:16 -0000 Received: (qmail 15012 invoked by uid 22791); 30 Apr 2007 00:24:15 -0000 X-Spam-Check-By: sourceware.org Received: from omta04sl.mx.bigpond.com (HELO omta04sl.mx.bigpond.com) (144.140.93.156) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Apr 2007 01:24:02 +0100 Received: from oaamta04sl.mx.bigpond.com ([144.136.165.71]) by omta04sl.mx.bigpond.com with ESMTP id <20070430002359.NEWV28583.omta04sl.mx.bigpond.com@oaamta04sl.mx.bigpond.com> for ; Mon, 30 Apr 2007 00:23:59 +0000 Received: from bubble.grove.modra.org ([144.136.165.71]) by oaamta04sl.mx.bigpond.com with ESMTP id <20070430002359.YKGM19156.oaamta04sl.mx.bigpond.com@bubble.grove.modra.org> for ; Mon, 30 Apr 2007 00:23:59 +0000 Received: by bubble.grove.modra.org (Postfix, from userid 500) id E91041C83CD; Mon, 30 Apr 2007 09:53:58 +0930 (CST) Date: Mon, 30 Apr 2007 05:05:00 -0000 From: Alan Modra To: binutils@sourceware.org Subject: Re: powerpc opcode table checks Message-ID: <20070430002358.GA13774@bubble.grove.modra.org> Mail-Followup-To: binutils@sourceware.org References: <20070420123126.GJ6840@bubble.grove.modra.org> <20070420134011.GK6840@bubble.grove.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070420134011.GK6840@bubble.grove.modra.org> User-Agent: Mutt/1.5.9i 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/msg00375.txt.bz2 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