From: DJ Delorie <dj@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gdb-patches@sourceware.org, kevinb@redhat.com
Subject: Re: [rx sim] add decode cache
Date: Thu, 29 Jul 2010 22:00:00 -0000 [thread overview]
Message-ID: <201007292200.o6TM0TlC021758@greed.delorie.com> (raw)
In-Reply-To: <201007291741.50553.vapier@gentoo.org> (message from Mike Frysinger on Thu, 29 Jul 2010 17:41:49 -0400)
> ok, so the cached info isnt as generic as i'd like ;). i wonder if
> we could fit a cache in there somewhere though ...
I don't think the decode is as cpu-intensive as the semantics, though.
It seems to me there are a *lot* of loops in most software, so the
more info you can re-use, the better. Actually, decoding a single
opcode's syntax and semantics doesn't take that long, it's just that
benchmarks tend to run *zillions* of opcodes, so even tiny savings add
up.
> doesnt seem like it's limited to CISC arches though ... in the
> Blackfin decode/sim, we too have a big tree of if/switch/masks to
> pull out arguments ive always been annoyed that we had to copy the
> decode file, gut it, and then fill in the sim pieces to make it
> work. seems like this opc2c might be a way back from that.
There's no reason why it *wouldn't* work for RISC architectures, of
course, I just never tried it, and don't know how optimal it would be
with it. However, if you have a RISC case where an operand field
isn't fully used, and certain operand patterns mean a whole different
opcode, opc2c can help you there - it will only decode to a specific
opcode if its operands are valid too, which is *really* hard to get
right with simple mask tables.
For the m32c, I used opc2c for the simulator, and cgen was used for
everything else. For RX, opc2c was pushed to libopcodes, and it's
used for the simulator, disassembler, *and* gdb. Nowhere else are RX
opcodes decoded. Maybe Kevin can comment on how different it was to
use opc2c's decoder for gdb's prolog analyzer?
For the RX assembler, I used bison. The resulting file *looks* like
an opc2c input file - syntax followed by semantics - but I didn't try
to use the same input file for both purposes.
next prev parent reply other threads:[~2010-07-29 22:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-29 18:42 DJ Delorie
2010-07-29 19:23 ` Mike Frysinger
2010-07-29 19:34 ` DJ Delorie
2010-07-29 21:42 ` Mike Frysinger
2010-07-29 22:00 ` DJ Delorie [this message]
2010-07-30 0:09 ` Mike Frysinger
2010-07-30 0:17 ` DJ Delorie
2010-07-30 1:04 ` Kevin Buettner
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=201007292200.o6TM0TlC021758@greed.delorie.com \
--to=dj@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@redhat.com \
--cc=vapier@gentoo.org \
/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