[Top][All Lists]
[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
[Qemu-devel] [PATCH v2 08/26] tcg: always mark dead input arguments as dead, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 26/26] tcg: remove compatiblity call flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 07/26] tcg: rewrite tcg_reg_alloc_mov(), Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 11/26] tcg: fix some op flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 24/26] target-sparc: rename helper flags, Aurelien Jarno, 2012/10/09