From: Doug Evans <dje@transmeta.com>
To: "Jie Zhang" <jzhang918@hotmail.com>
Cc: "Frank Ch. Eigler" <fche@redhat.com>, <cgen@sources.redhat.com>
Subject: Re: Require some enhancement in CGEN for decoder of disassember
Date: Sun, 24 Nov 2002 21:08:00 -0000 [thread overview]
Message-ID: <15841.45123.655171.135406@xris-athlon.transmeta.com> (raw)
In-Reply-To: <DAV14GAyW8bsb9WjGez0000c86c@hotmail.com>
Jie Zhang writes:
> > 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).
>
> Thank you!
> The first method is not feasible, because the field acts as operand in
> all insns (about 30) but one. We would have 30 * 15 insn descriptions
> if we replicated each insn 15 times.
>
> We tried the second method. The situation became better. But there are still
> some insns disassembled incorrectly.
>
> I expect that CGEN can find out such operand and generate some code
> to deal with it.
Assuming I understand the issue correctly,
"ifield assertions" is the intended way to handle this.
[relevant insns have an additional predicate that is used
to assert whether a particular set of field values is ok]
If they don't work here then let's make them work.
next prev parent reply other threads:[~2002-11-25 5:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-20 19:59 Jie Zhang
2002-11-22 13:12 ` Frank Ch. Eigler
2002-11-24 19:14 ` Jie Zhang
2002-11-24 21:08 ` Doug Evans [this message]
2002-11-26 0:48 ` Jie Zhang
2002-11-26 23:47 ` Jie Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15841.45123.655171.135406@xris-athlon.transmeta.com \
--to=dje@transmeta.com \
--cc=cgen@sources.redhat.com \
--cc=fche@redhat.com \
--cc=jzhang918@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).