This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Optimize manual byte swap implementations v3



On Apr 27, 2009, at 1:03 AM, Andreas Krebbel wrote:


Hi Richard,

as proposed by Mark I did some experiments with the ARM target. I think the byte swap optimizer is especially benefical for targets where a "bswap" instruction has been added with some later CPU level. For these targets it is especially ugly to enhance code with inline assemblies since it would require CPU level checks. For ARM the instruction has been added with ARMv6. Currently neither the Linux kernel nor newlib use the "rev" instruction to implement byte swaps.

Can't code like this just use __builtin_bswap_x? Presumably this expands to decent code when the target cpu doesn't support a bswap instruction.


-Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]