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

Frank Ch. Eigler wrote:

>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.
>  
>
This is correct. The switch only disambiguates the valid insns. 
Sometimes when a case has been reduced to only one insn, there are still 
some opcodes bits which have not been tested. In this case only, the 
additional test is generated.

>  
>
>>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?
>  
>
Please point out any cases where the test is not needed and I will see 
if I can eliminate it in those cases.

Thanks,
Dave

  reply	other threads:[~2007-03-23 14:13 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
2007-03-23 14:13   ` Dave Brolley [this message]
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=4603DD87.9090002@redhat.com \
    --to=brolley@redhat.com \
    --cc=cgen@sourceware.org \
    --cc=chuanhua.chang@gmail.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).