qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Stuart Brady <sdb@zubnet.me.uk>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] tcg shift ops and magnitudes larger than register size
Date: Sat, 15 Jan 2011 22:00:14 +0100	[thread overview]
Message-ID: <20110115210014.GC24889@laped.lan> (raw)
In-Reply-To: <20110114232621.GA5779@zubnet.me.uk>

On Fri, Jan 14, 2011 at 11:26:21PM +0000, Stuart Brady wrote:
> On Thu, Jan 13, 2011 at 09:56:35AM +0100, Edgar E. Iglesias wrote:
> > On Wed, Jan 12, 2011 at 08:13:45PM -0500, Mike Frysinger wrote:
> > > are there any rules with the tcg sar/shl/shr ops and their magnitudes
> > > ?  such as "magnitudes cannot be larger than the register size" ?
> > 
> > Yes, the result is undefined in those cases.
> 
> The result is also undefined if the magnitude is *equal* to the width of
> the variable.
> 
> > You need to handle it in the translator. CRIS has similar semantics
> > as your arch. See target-cris/translate.c:t_gen_lsl() for one way
> > of doing it. There might be better ways though.
> 
> How widely used would a set of optional shift ops be, where the magnitude
> may be equal to (or exceed?) the width?

My guess is that they wouldn't be used very much. But they might deserve
a helper call that emits a good sequence of tcg calls to do the job.


> Are there other helpers or op sequences that are commonly shared between
> targets that would be candidates for splitting out into common code?

I'm sure there are. You just have to find them :)


> I know that a proliferation of ops is to be avoided -- the not, neg,
> andc, orc, eqv, nand and nor ops have been useful though, despite not
> being strictly essential, and the same could be said for the ext*s, ext*z
> and bswap ops.

There are many more that aren't "strictly essential". IMO, adding helpers
that emit frequently used sequences of tcg calls is mostly good.

Adding tcg ops that get exposed to the middle and backend is a different
matter.

Cheers

      reply	other threads:[~2011-01-15 21:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13  1:13 [Qemu-devel] tcg shift ops and magnitudes larger than register size Mike Frysinger
2011-01-13  8:56 ` Edgar E. Iglesias
2011-01-14 23:26   ` Stuart Brady
2011-01-15 21:00     ` Edgar E. Iglesias [this message]

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=20110115210014.GC24889@laped.lan \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sdb@zubnet.me.uk \
    /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 NNTP newsgroup(s).