public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Joern Rennecke <joernr@arc.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: cgen@sources.redhat.com
Subject: decode-bitsize (Was: Re: delayed branches and zero overhead loops)
Date: Wed, 14 Feb 2007 18:58:00 -0000	[thread overview]
Message-ID: <20070214185717.GB18550@elsdt-razorfish.arc.com> (raw)
In-Reply-To: <20070213211152.GD20088@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]

On Tue, Feb 13, 2007 at 04:11:52PM -0500, Frank Ch. Eigler wrote:
> The decoder generator is fully automatic.  If you represent decodable
> bits without cheating, it will do a reasonable job.

Actually, I realize now that I have a much bigger problem with the decoder
generator.
Originally, I set out to set default-insn-bitsize, base-insn-bitsize and
default-insn-word-bitsize all to 16, because that's what I should do according
to the documentation.  However, that gave me tons of ambiguity warnings.
from previous postings on the cgen mailing list and the xstormy port I've
gathered that I have to set base-insn-bitsize to 32.  Apart from the
ilink / noilink thing, that got rid of the spurious ambiguity warnings.
However, when compiling the decoder, I got tons of warnings about neative
shifts.  Declaring base-insn-bitsize as 32 does not make it so: it still
stays 16 once you have 16 bit instructions.
And the second level decoding tables are also generated using base-insn.
As bits from beyond the first 16 bits are needed, this results in a negative
shift.
I had though that I had solved this porblem by declaring bit fields in the
second word using a word offset, but i've found now that the effect is that
the decoder generator will completely mask out these bits from the insn -
even in the final comparisons against entire_insn to check if there is a
match.
It won't mask it out in the constant value to compare against, though,
so any insn that requires a bit in the second 16 bits to be set is decoded as
@CPU@_INSN_X_INVALID.

When I put the fields back to use no word offsets, the matching tests
are OK, but as the decoding switch statements also use bits from
beyond the first 16, they again end up with negative shifts.
I've tried hacking -gen-decoder-switch so that it always fetches the required
bits, but all I get is a re-fetch of the first 16 bits.
So, the decode-bitsize in the table-guts somehow is 16, even though that
is insufficient to cover all the included bits.

I have appended a copy of ARCompact.cpu version that get translated to a
decoder with negative shifts.

[-- Attachment #2: ARCompact.cpu.bz2 --]
[-- Type: application/x-bzip2, Size: 17542 bytes --]

  parent reply	other threads:[~2007-02-14 18:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-13 15:37 delayed branches and zero overhead loops Joern Rennecke
2007-02-13 18:51 ` Frank Ch. Eigler
2007-02-13 21:00   ` Joern Rennecke
2007-02-13 21:12     ` Frank Ch. Eigler
2007-02-13 22:21       ` Joern Rennecke
2007-02-14 17:09         ` Dave Brolley
2007-02-14 18:30           ` Joern Rennecke
2007-02-14 19:52             ` Dave Brolley
2007-02-14 20:15               ` Joern Rennecke
2007-02-16 20:54                 ` Dave Brolley
2007-02-19  3:39                   ` Joern Rennecke
     [not found]                     ` <45D9C06A.4030903@redhat.com>
2007-02-19 15:56                       ` Joern Rennecke
2007-02-19 16:07                         ` Frank Ch. Eigler
2007-02-19 18:14                           ` Joern Rennecke
2007-02-19 18:19                             ` Dave Brolley
2007-02-22 15:50                               ` Joern Rennecke
2007-02-22 16:08                               ` insert evaluation for multi-ifields broken Joern Rennecke
2007-02-22 16:56                                 ` Dave Brolley
2007-02-22 18:14                                   ` Joern Rennecke
2007-02-23 17:45                                     ` Dave Brolley
2007-02-15 16:54               ` delayed branches and zero overhead loops Joern Rennecke
2007-02-14 18:58       ` Joern Rennecke [this message]
2007-02-13 19:25 ` Doug Evans
2007-02-13 20:38   ` Joern Rennecke
2007-02-14 18:30     ` Doug Evans
2007-02-14 19:22       ` Joern Rennecke

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=20070214185717.GB18550@elsdt-razorfish.arc.com \
    --to=joernr@arc.com \
    --cc=cgen@sources.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).