From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29460 invoked by alias); 22 Nov 2002 21:12:00 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 29453 invoked from network); 22 Nov 2002 21:11:59 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 22 Nov 2002 21:11:59 -0000 Received: from toenail.toronto.redhat.com (toenail.toronto.redhat.com [172.16.14.211]) by touchme.toronto.redhat.com (Postfix) with ESMTP id CC50D80023E; Fri, 22 Nov 2002 16:11:58 -0500 (EST) Received: (from fche@localhost) by toenail.toronto.redhat.com (8.11.6/8.11.6) id gAMLBwC15959; Fri, 22 Nov 2002 16:11:58 -0500 Date: Fri, 22 Nov 2002 13:12:00 -0000 From: "Frank Ch. Eigler" To: Jie Zhang Cc: cgen@sources.redhat.com Subject: Re: Require some enhancement in CGEN for decoder of disassember Message-ID: <20021122161158.C1160@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from jzhang918@hotmail.com on Thu, Nov 21, 2002 at 11:59:13AM +0800 X-SW-Source: 2002-q4/txt/msg00033.txt.bz2 Hi - On Thu, Nov 21, 2002 at 11:59:13AM +0800, Jie Zhang wrote: > I encounter a problem when I'm using CGEN to port binutils. > In my target, there is a rather strange 4-bit field. > There are two insns, A and B. This field is operand in insn A, > but opcode for insn B. > [...] > In insn A, the value of the operand can range from 0 through 14. > If this field is 15, then the insn is B. > [...] One way to model this with CGEN is to act like the operand/opcode field is opcode only, by replicating instruction A 15 times, each with a different value (0..14) for the problematic field. You might also need some custom operand parsers to assert that each variant of A will match only if the given logical operand matches the actual one. If the only piece of the toolchain producing incorrect behavior is the disassembler, you may also be able to make it work by turning off disassembly hashing (#define CGEN_DIS_HASH(buf,value) 0). - FChE