[PATCH v7] arm: use built-in byte swap function

Dirk Behme dirk.behme at gmail.com
Sun May 26 01:38:37 EDT 2013


Am 23.05.2013 18:46, schrieb Kim Phillips:
> Enable the compiler intrinsic for byte swapping on arch ARM.  This
> allows the compiler to detect and be able to optimize out byte
> swappings, and has a very modest benefit on vmlinux size (Linaro gcc
> 4.8):

I'm no GCC tool chain expert, so I just have an understanding 
question: Could anyone kindly give a brief explanation (*) of what the 
advantage of this is on ARM?

http://comments.gmane.org/gmane.linux.kernel.cross-arch/16016

mentions "lwbrx/stwbrx on PowerPC, movbe on Atom". But for ARM?

I haven't understood yet why the __arch_swabXX() in 
arch/arm/include/asm/swab.h [1] aren't sufficient? How can this be 
done better? E.g. does anybody have a disassembly without/with this 
change to illustrate that?

Many thanks and best regards

Dirk

(*) or in case this already done provide a link. I couldn't find it in 
the discussion of this patch.

[1]

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/include/asm/swab.h





More information about the linux-arm-kernel mailing list