qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 14/26] tcg: rework TCG helper flags


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH v2 14/26] tcg: rework TCG helper flags
Date: Fri, 19 Oct 2012 22:24:12 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Oct 10, 2012 at 10:11:54AM -0700, Richard Henderson wrote:
> On 10/09/2012 12:56 PM, Aurelien Jarno wrote:
> > +                    if (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS |
> > +                                        TCG_CALL_NO_READ_GLOBALS))) {
> 
> Code like this would be shorter, and perhaps clearer, by
> 
> > +/* Helper does not read globals (either directly or through an exception). 
> > It
> > +   implies TCG_CALL_NO_WRITE_GLOBALS. */
> > +#define TCG_CALL_NO_READ_GLOBALS    0x0010
> > +/* Helper does not write globals */
> > +#define TCG_CALL_NO_WRITE_GLOBALS   0x0020
> 
> having RG actually include WG, i.e.
> 
> #define TCG_CALL_NO_READ_GLOBALS  0x0030
> 

Agreed. On the other hand, the few lines just above the one your quoted
would be more complicated:

+                    if (!(call_flags & TCG_CALL_NO_READ_GLOBALS)) {
+                        /* globals should be synced to memory */
+                        memset(mem_temps, 1, s->nb_globals);
+                    }

would have to be written:

+                    if (!(call_flags & TCG_CALL_NO_READ_WRITE_GLOBALS) ||
+                        (call_flags & TCG_CALL_WRITE_GLOBALS)) {
+                        /* globals should be synced to memory */
+                        memset(mem_temps, 1, s->nb_globals);
+                    }

Note sure it makes the things clearer, and definitely not shorter.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net



reply via email to

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