Re: [PATCH 2/8] compat: make gcc bswap an inline function
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 16, 2011, 09:21 UTC
- Message-ID
- <4D808126.8070706@viscovery.net>
- In-Reply-To
- <20110316070049.GC5988@elie>
Am 3/16/2011 8:00, schrieb Jonathan Nieder:
> +static inline uint32_t git_bswap32(uint32_t x)
> +{
> + uint32_t result;
> + if (__builtin_constant_p(x))Can this predicate ever be true? Isn't it false even if the function is inlined?
Show 5 quoted lines
> + result = default_swab32(x);
> + else
> + __asm__("bswap %0" : "=r" (result) : "0" (x));
> + return result;
> +}-- Hannes