public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: Chuan-Hua Chang <chuanhua.chang@gmail.com>
Cc: cgen@sourceware.org
Subject: Re: generated decoder code question
Date: Fri, 23 Mar 2007 11:31:00 -0000	[thread overview]
Message-ID: <20070323113053.GR27273@redhat.com> (raw)
In-Reply-To: <aefe1a0f0703230140r69d7a493y9d0e24014534222b@mail.gmail.com>

Hi -

> In the utils-sim.scm file, the "-gen-decode-insn-entry" function has
> the following lines:
> 		     ; Generate code to check that all of the opcode bits 
> 		     for this insn match
> [...]
> It generates an IF-statement to check the opcode again inside the case
> statement before doing the real extraction. This seems really
> redundant 


I believe that this check is done because the switch statement by
itself is not necessarily sufficient.  The switch may simply
disambiguate the instructions (so no two candidate instructions fall
into the same switch case), but that could leave some additional
decodeable bits.  Those bits would need to be tested to tell apart the
remaining candidate instruction from illegal opcodes.

> and make the decoder inefficient.

Do you have a sense of how frequently such a test is completely
redundant, and how much additional time this test takes?

- FChE

  reply	other threads:[~2007-03-23 11:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23  8:40 Chuan-Hua Chang
2007-03-23 11:31 ` Frank Ch. Eigler [this message]
2007-03-23 14:13   ` Dave Brolley
2007-03-26  5:50     ` Chuan-Hua Chang
2007-03-23 13:02 ` Dave Brolley

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=20070323113053.GR27273@redhat.com \
    --to=fche@redhat.com \
    --cc=cgen@sourceware.org \
    --cc=chuanhua.chang@gmail.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).