Re: [RFC] arm: use built-in byte swap function

From: Woodhouse, David
Date: Tue Jan 29 2013 - 10:10:52 EST


On Tue, 2013-01-29 at 08:53 -0600, Rob Herring wrote:
> If you specify to use the builtin's, do you still get inline rev
> instructions emitted?

You mean from the architecture's __arch_swab32() et al. macros?

No. If the architecture enables ARCH_USE_BUILTIN_BSWAP and the compiler
version checks indicate that the correspondingly-sized builtin is
available, then the builtin will be used. Only if the arch *doesn't* set
ARCH_USE_BUILTIN_BSWAP, or if the compiler is old enough not to have the
corresponding intrinsic, will the inline assembler in the __arch_swabXX
macros get used.

Note, however, that there is no such compiler intrinsic for swahb32(),
which is where rev16 gets used. That's still being left to the inline
asm in all cases.

--
Sent with MeeGo's ActiveSync support.

David Woodhouse Open Source Technology Centre
David.Woodhouse@xxxxxxxxx Intel Corporation



Attachment: smime.p7s
Description: S/MIME cryptographic signature