public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Jie Zhang" <jzhang918@hotmail.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: <cgen@sources.redhat.com>
Subject: Re: Require some enhancement in CGEN for decoder of disassember
Date: Sun, 24 Nov 2002 19:14:00 -0000	[thread overview]
Message-ID: <DAV14GAyW8bsb9WjGez0000c86c@hotmail.com> (raw)
In-Reply-To: <20021122161158.C1160@redhat.com>


----- Original Message -----
From: "Frank Ch. Eigler" <fche@redhat.com>
To: "Jie Zhang" <jzhang918@hotmail.com>
Cc: <cgen@sources.redhat.com>


> 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
>

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.

-Jie Zhang

  reply	other threads:[~2002-11-25  3:14 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 [this message]
2002-11-24 21:08     ` Doug Evans
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=DAV14GAyW8bsb9WjGez0000c86c@hotmail.com \
    --to=jzhang918@hotmail.com \
    --cc=cgen@sources.redhat.com \
    --cc=fche@redhat.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).