[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 at 17:38, <andrew.cooper3@xxxxxxxxxx> wrote:
> 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.

So taking just the first example I've converted: Do you think this

static bool_t even_parity(uint8_t v)
{
    asm ( "test %1,%1"
#ifdef __GCC_ASM_FLAG_OUTPUTS__
          : "=@ccp" (v)
#else
          "; setp %0"
          : "=qm" (v)
#endif
          : "q" (v) );

    return v;
}

is better than the original? I'm unsure, and I'm actually inclined to
think that then the abstraction alternative might look better.

Jan


_______________________________________________
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®.