[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv

From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv
Date: Tue, 13 Dec 2011 16:23:11 +0000
User-agent: KMail/1.13.7 (Linux/3.1.0-1-amd64; KDE/4.6.5; x86_64; ; )

> 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 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]