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

Re: [Xen-devel] [PATCH] x86: use gcc6'es flags asm() output support



On 01/07/16 16:01, Jan Beulich wrote:
> ..., rendering affected code more efficient and smaller.

Ooh - this is a neat feature.

>
> Note that in atomic.h this at once does away with the redundant output
> and input specifications of the memory location touched.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> TBD: Do we want to abstract the pattern
>       asm ( "...; set<cc> %<out>" : "=<cons>" (var) ... )
> matching
>       asm ( "..." : "=@cc<cc>" (var) ... )
> via some macro? While this would eliminate many (all?) of the
> conditionals added here, it would result in the : no longer being
> visible in the actual source, making the asm()s look somewhat odd.
> Otherwise, to limit code duplication, it may be preferable to put
> the #ifdef-s inside the asm()s instead of around them.

I would recommend not abstracting them.  asm() statements are already
subtle/hard enough to get right, and hiding the :'s will only make
matters worse.

As for interleaving inside the asm statement itself, we already have
precedent for that with the HAVE_GAS_* predicates.  It would make the
patch rather larger, but might end up looking cleaner.  It is probably
also worth switching to named parameters to reduce the risk of getting
positional parameters out of order.

As for the content of the change itself, Reviewed-by: Andrew Cooper
<andrew.cooper3@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.