public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Michael Chapman" <Michael.Chapman@synopsys.com>
To: "Ben Elliston" <bje@redhat.com>,
	"Michael Chapman" <Michael.Chapman@synopsys.COM>
Cc: <cgen@sources.redhat.com>
Subject: RE: Disassembly of instruction with 4 bit opcode
Date: Mon, 04 Nov 2002 06:24:00 -0000	[thread overview]
Message-ID: <NEBBIAJILEHBJOLKLAGOEECKCJAA.michaelc@synopsys.com> (raw)
In-Reply-To: <m3znsp5xbo.fsf@scooby.brisbane.redhat.com>

Hi Ben,

What worked for me was:-

/* Override disassembly hashing - there are variable bits in the top
   byte of these instructions.  */
#define CGEN_DIS_HASH_SIZE 16
#define CGEN_DIS_HASH(buf,value) ((* (unsigned char*) (buf)) & 0x0f)

However, presumably it would be more efficient to make this a bit
more intelligent and only mask out the rest of the opcode in the
case that the 4 LSB bits are 0xc.

Regards,
Mike Chapman

-----Original Message-----
From: bje@scooby.brisbane.redhat.com
[mailto:bje@scooby.brisbane.redhat.com]On Behalf Of Ben Elliston
Sent: Monday, 04 November, 2002 13:33
To: Michael Chapman
Cc: cgen@sources.redhat.com
Subject: Re: Disassembly of instruction with 4 bit opcode


Hi Michael,

>>>>> "Michael" == Michael Chapman <Michael.Chapman@synopsys.com> writes:

  Michael> The problem is with the "call" instructions which use only
  Michael> 4 bits of the opcode using the remained for the address.
  Michael> Everything is strictly little endian with the opcode always
  Michael> appearing in the least significant 8 bits (or 4 bits in the
  Michael> case of call) of the instruction.  When I dissassemble the
  Michael> following (listing output from the assembler)
  [...]
  Michael>   10:	cc 00       	*unknown*

Investigate using something like this in your <arch>.opc file:

  /* Override disassembly hashing - there are variable bits in the top
     byte of these instructions.  */
  #define CGEN_DIS_HASH_SIZE 8
  #define CGEN_DIS_HASH(buf,value) (((* (unsigned char*) (buf)) >> 5) %
CGEN_DIS_HASH_SIZE)

Cheers, Ben

      reply	other threads:[~2002-11-04 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-04  4:23 Michael Chapman
2002-11-04  4:42 ` Ben Elliston
2002-11-04  6:24   ` Michael Chapman [this message]

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=NEBBIAJILEHBJOLKLAGOEECKCJAA.michaelc@synopsys.com \
    --to=michael.chapman@synopsys.com \
    --cc=bje@redhat.com \
    --cc=cgen@sources.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).