All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: Samuel Thibault <samuel.thibault@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: [PATCH] x86: fix variable_test_bit() asmconstraints
Date: Fri, 14 Mar 2008 14:18:49 +0000	[thread overview]
Message-ID: <47DA9759.76E4.0078.0@novell.com> (raw)
In-Reply-To: <20080314135938.GN4358@implementation.uk.xensource.com>

>>> Samuel Thibault <samuel.thibault@eu.citrix.com> 14.03.08 14:59 >>>
>Jan Beulich, le Fri 14 Mar 2008 13:51:26 +0000, a écrit :
>> >memory-clobber would be needed for the atomic ops, but a dummy memory
>> >operand would suffice for non-atomic ops. I used memory clobber everywhere
>> 
>> Atomic ops imply a barrier (otherwise the compiler can defeat the
>> purpose of the atomic operation). The non-atomic ones don't need a
>> dummy operand, but one that precisely describes the place in memory
>> that changes.
>
>Mmm, won't that unnecessarily make the compiler put code to compute that
>place?

Not generally - if both the 'used' and the 'fake' operands are apart just
by a constant offset, the same base/index expression will be used by
the compiler, just with different offsets. If the bit position is not a
constant that might well be true, though (and I ought to check) - since
in that case the compiler can't predict which part of the array changes*,
splitting the two cases with a __builtin_constant_p() should be possible,
though. The constant section then would need two operands (one of
them fake), while the variable section would need just one.

* In theory, the compiler could even then detect certain cases of
accesses to the same field. If we're afraid of that, the we'd need to
use precise operand descriptions here or, as Keir suggested, just
live with using a memory barrier instead of precise operand constraints.

Jan

  parent reply	other threads:[~2008-03-14 14:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14 11:23 [PATCH] x86: fix variable_test_bit() asm constraints Jan Beulich
2008-03-14 11:55 ` Keir Fraser
2008-03-14 11:59   ` Keir Fraser
2008-03-14 13:46     ` [PATCH] x86: fix variable_test_bit() asmconstraints Jan Beulich
2008-03-14 12:06   ` [PATCH] x86: fix variable_test_bit() asm constraints Keir Fraser
2008-03-14 13:51   ` [PATCH] x86: fix variable_test_bit() asmconstraints Jan Beulich
2008-03-14 13:57     ` Keir Fraser
2008-03-14 14:11       ` [PATCH] x86: fix variable_test_bit()asmconstraints Jan Beulich
2008-03-14 15:37         ` Keir Fraser
2008-03-14 16:42           ` Jan Beulich
2008-03-14 17:08             ` Keir Fraser
2008-03-16 14:08               ` Keir Fraser
2008-03-14 13:59     ` [PATCH] x86: fix variable_test_bit() asmconstraints Samuel Thibault
2008-03-14 14:04       ` Keir Fraser
2008-03-14 14:18       ` Jan Beulich [this message]
2008-03-14 15:17       ` Jan Beulich

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=47DA9759.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=samuel.thibault@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.