public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: Joern Rennecke <Joern.Rennecke@arc.com>
Cc: cgen@sources.redhat.com
Subject: Re: CGEN_DIS_HASH: how to get endianness and/or instruction size?
Date: Fri, 26 Jan 2007 01:31:00 -0000	[thread overview]
Message-ID: <20070126013107.GH30933@redhat.com> (raw)
In-Reply-To: <20A30789B9F48C4E9D71A188EFE8042C2BC65C@elexch01.arc.com>

Hi -

joern wrote:

> [...]
> The top 5 bits of the first 16 bit word are what is known as major
> opcode field.  [...]
> I reckon that, given a suitably endian-correted input,
> I could make an adequate hash by using a switch based on
> the 5 bit major opcode to decide which bits from the first 16
> bit word to use.

Heck, just use those five bits.

> I had already written the hash function, only to discover that the
> endian check depended on an argument that was not passed to my
> macro/function.

You should use the *value* rather than *buf* input.

> Its easy to change his code into incorrect and/or useless (return 0)
> code that will compile [...]

It is neither incorrect nor useless.  It just means that the hash
table will be degenerate, and a linear search will be required for
each disassembled instruction.  It won't hurt anyone and will only
slightly worsen global warming.

> Unless otherwise expressly stated, this message does not create or vary =
> any contractual relationship between you and ARC International.  [...]

That's a relief!

- FChE

  reply	other threads:[~2007-01-26  1:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-26  1:11 Joern Rennecke
2007-01-26  1:31 ` Frank Ch. Eigler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-26 11:17 Joern Rennecke
2007-01-25 14:20 Joern Rennecke
2007-01-25 15:00 ` Frank Ch. Eigler
2007-01-25 20:30   ` Joern Rennecke
2007-01-25 22:15     ` Frank Ch. Eigler

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=20070126013107.GH30933@redhat.com \
    --to=fche@redhat.com \
    --cc=Joern.Rennecke@arc.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).