public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@sebabeach.org>
To: "Frank Ch. Eigler" <fche@redhat.com>,
	dj@redhat.com,   cgen@sourceware.org
Subject: better use of disassembly hash table by mep port
Date: Sun, 20 Dec 2009 09:04:00 -0000	[thread overview]
Message-ID: <4B2DE87B.2030806@sebabeach.org> (raw)

I think I understand the MEP port enough to have it starting using the 
disassembly hash table better (rather than hashing every insn to the 
same slot, blech).
The basics have always been there, we just need to extend it a little.
[Another way to go, of course, is to add a simulator-style decoder to 
the disassembler.  There's various reasons why I didn't do that in the 
beginning.  It'll probably be useful to add it some day.]

AIUI, different MEP ISAs use different opcode bits and so the hashing is 
useless ... if one tries to hash *all* insns for *all* ISAs in *one* 
table.  But if one takes the current isa/mach/config into account when 
doing the hashing and ignore insns that don't match it, I think a useful 
hash is possible.  Right?
[I'm assuming the chip doesn't do something excessively funky and that 
for any particular isa/mach/config context there are *some* opcode bits 
common to all relevant instructions for that context.]  I gather the MEP 
port doesn't do that because more parameters are used to decide whether 
an insn is valid for the current context than what cgen currently uses 
(which is isa/mach/endian).  See mep.opc:mep_cgen_insn_supported.

If we enhance the disassembler's instruction recognizer hash table 
builder to let the target record additional parameters to use to decide 
when a new CGEN_CPU_DESC needs to be created, and let the target provide 
routines to access/use that info, I think that's all that's needed.  
Plus , of course, a hash function - I think the code can pick something 
at runtime if the port doesn't provide one.  E.g. pick all the bits that 
are constant in the first instruction word.  An N-stage hash could be 
done for ISAs that have few common bits among all insns, but have more 
common bits among groups of instructions.  Maybe we could even 
use/borrow the simulator's decoder-generator to drive it.

Comments?
Am I missing anything?

             reply	other threads:[~2009-12-20  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-20  9:04 Doug Evans [this message]
2009-12-21 19:25 ` DJ Delorie

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=4B2DE87B.2030806@sebabeach.org \
    --to=dje@sebabeach.org \
    --cc=cgen@sourceware.org \
    --cc=dj@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).