qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv
Date: Tue, 13 Dec 2011 16:23:11 +0000	[thread overview]
Message-ID: <201112131623.12363.paul@codesourcery.com> (raw)
In-Reply-To: <4EE74F13.9000908@web.de>

> Am 12.12.2011 16:58, schrieb Paul Brook:
> >> For me the most annoying issue was that tcg_gen_qemu_{ld,st}* needs
> >> TCGv.
> > 
> > You mean the value transferred is always TCGv sized, so ld32u requires an
> > additional truncation before doing 32-bit arithmetic?  Fixing that is
> > completely independent of making TCGv a separate type.
> 
> tcg_gen_qemu_{ld,st} (guest) differs from tcg_gen_{ld,st} (host) in that
> they require a TCGv ret/arg (all use TCGv addr). I.e., to read an 8-bit
> memory-mapped register on a 64-bit target with tcg_gen_qemu_ld8u we need
> a TCGv temporary and trunc to i32 afterwards (smallest currently
> available variable size) or unnecessarily blow up storage size to
> target_long/TCGv everywhere.
> 
> So, yes, adding an _i32 version may make sense, to at least encapsulate
> it at TCG level.
> 
> And without my patches I might have not noticed this design flaw. :)

This is purely an optimization issue.  If you're concerned about cases where 
TCG generates dumb code then this is probably the least of your problems.
If you omit the truncation then the build will fail.  My guess is that in many  
cases we also manage to optimize away the worst of the redundant 
extension/truncation.

Paul

      reply	other threads:[~2011-12-13 16:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10  9:02 [Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv Andreas Färber
2011-12-10  9:02 ` [Qemu-devel] [PATCH 1/4] tcg: Introduce {MAKE,GET}_TCGV_TL macros Andreas Färber
2011-12-10  9:02 ` [Qemu-devel] [PATCH 2/4] tcg: Convert *_tl*() macros to inline functions Andreas Färber
2011-12-10 21:06   ` [Qemu-devel] [PATCH v2] " Andreas Färber
2011-12-10  9:02 ` [Qemu-devel] [PATCH 3/4] tcg: Update TCGV_{UNUSED,EQUAL}() macros Andreas Färber
2011-12-10  9:02 ` [Qemu-devel] [PATCH 4/4] tcg: Allow to detect TCGv misuses Andreas Färber
2011-12-10 10:07 ` [Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv Peter Maydell
2011-12-10 11:14   ` Andreas Färber
2011-12-11 23:28     ` Paul Brook
2011-12-12 10:39       ` Andreas Färber
2011-12-12 15:58         ` Paul Brook
2011-12-13 12:43           ` Andreas Färber
2011-12-13 16:26             ` Paul Brook
2011-12-14 11:41               ` Andreas Färber
2011-12-13 13:11           ` Andreas Färber
2011-12-13 16:23             ` Paul Brook [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=201112131623.12363.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=andreas.faerber@web.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).