This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Optimize manual byte swap implementations using the GCC bswap builtin
- From: Andrew Haley <aph at redhat dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Nov 2008 14:59:55 +0000
- Subject: Re: [PATCH] Optimize manual byte swap implementations using the GCC bswap builtin
- References: <20081128140056.GA22640@homer.boeblingen.de.ibm.com>
Andreas Krebbel wrote:
> with the attached patch GCC detects manual byte swap implementations
> and emits a call to the bswap builtins instead. It is implemented as a
> tree-level pass in tree-ssa-math-opts.c.
> The testcase includes the most prominent byte swap implementation for
> 32 and 64 bit copied from the Linux kernel.
> I've bootstrapped the patch on x86_64, s390 and s390x.
> The included testcase succeeds on these 3 targets.
> Ok for mainline when entering stage 1?
Did you check htons() et al?