From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPJ7A-0006lf-MF for qemu-devel@nongnu.org; Fri, 19 Oct 2012 16:24:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPJ79-0006Hz-Gz for qemu-devel@nongnu.org; Fri, 19 Oct 2012 16:24:16 -0400 Received: from hall.aurel32.net ([88.191.126.93]:41504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPJ79-0006Hb-Ax for qemu-devel@nongnu.org; Fri, 19 Oct 2012 16:24:15 -0400 Date: Fri, 19 Oct 2012 22:24:12 +0200 From: Aurelien Jarno Message-ID: <20121019202412.GA6109@ohm.aurel32.net> References: <1349812584-19551-1-git-send-email-aurelien@aurel32.net> <1349812584-19551-15-git-send-email-aurelien@aurel32.net> <5075AC5A.6040503@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5075AC5A.6040503@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v2 14/26] tcg: rework TCG helper flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org 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 aurelien@aurel32.net http://www.aurel32.net