public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
To: brolley@redhat.com
Cc: hans-peter.nilsson@axis.com, cgen@sourceware.org, jimb@redhat.com
Subject: Re: Unbreak CRIS sim: fix -gen-decode-insn-entry.  And why the widened  mem fetch?
Date: Mon, 05 Dec 2005 01:31:00 -0000	[thread overview]
Message-ID: <200512050130.jB51UttW013171@ignucius.se.axis.com> (raw)
In-Reply-To: <43909CD6.2090508@redhat.com> (message from Dave Brolley on Fri, 	02 Dec 2005 14:13:26 -0500)

> Date: Fri, 02 Dec 2005 14:13:26 -0500
> From: Dave Brolley <brolley@redhat.com>

> The switch generator stops when it has tested enough bits to resolve 
> ambiguity among the defined insns, but since it wasn't going on to test 
> the remaining bits, the decoder was recognizing invalid insns as valid. 
> This additional test goes on to test all the fixed bits in each insn to 
> ensure that they are all correct.

I assume you mean with opcode definitions for

opcode=
0?0
1?0

(where opcode & 2 is don't care and opcode & 1 is invalid)
that there was *before* the extra generated code, only a test
generated for (opcode & 4) and that there's *now* (opcode & 5)
== 4 and (opcode & 5) == 0, with 1 and 5 flagged as invalid
insns; not that you mean that there are now checks for (opcode &
7) == 0 and (opcode & 7) == 4.

> It does appear that we could be 
> smarter about generating the test, however. In this case the tests 
> appear to be redundant. We could probably add some logic to test only 
> the untested bits and to not generate the additional test at all if all 
> of the bits have already been tested.

Recent GCC should optimize out any obviously redundant tests
with if-tests that are covered by an outer switch/case.

Anyway, I briefly tested timing before/after a regened sim/cris,
and time difference seems to be in the noise, at least for the
test programs I used.  I guess most interesting codes fit nicely
in the scache or something.  So I'm only worried about
correctness with the widened opcode fetches and the opcode
checks as above.

> >The change below mimics the test in
> >sim-decode.scm:-gen-decode-fn where entire_insn is conditionally
> >declared as a parameter to @prefix@_decode.
> This change looks ok to me. Please commit it.

Done, thanks.

brgds, H-P

  reply	other threads:[~2005-12-05  1:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-02  3:42 Hans-Peter Nilsson
2005-12-02  7:06 ` Jim Blandy
2005-12-02 15:42   ` Hans-Peter Nilsson
2005-12-02 19:13 ` Dave Brolley
2005-12-05  1:31   ` Hans-Peter Nilsson [this message]
2005-12-05 17:11     ` 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=200512050130.jB51UttW013171@ignucius.se.axis.com \
    --to=hans-peter.nilsson@axis.com \
    --cc=brolley@redhat.com \
    --cc=cgen@sourceware.org \
    --cc=jimb@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).