This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize manual byte swap implementations v3
- From: Chris Lattner <clattner at apple dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, Mark Mitchell <mark at codesourcery dot com>, Andrew Haley <aph at redhat dot com>, gcc-patches at gcc dot gnu dot org, rdsandiford at googlemail dot com
- Date: Mon, 27 Apr 2009 10:32:37 -0700
- Subject: Re: [PATCH] Optimize manual byte swap implementations v3
- References: <20090209145520.GA32536@bart> <49931E43.1050307@codesourcery.com> <499414EA.9010204@linux.vnet.ibm.com> <49945590.50606@codesourcery.com> <873aehgxn1.fsf@firetop.home> <49971B86.4000702@codesourcery.com> <499727DB.6020704@redhat.com> <49986FE4.8020604@codesourcery.com> <84fc9c000904241354n50c1b65s6369e4272a76bb98@mail.gmail.com> <49F566D0.7050608@linux.vnet.ibm.com>
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