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: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- To: Chris Lattner <clattner at apple 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: Tue, 28 Apr 2009 11:07:59 +0200
- 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> <4C219B03-E449-42F3-8ED4-10828C193624@apple.com>
Hi Chris,
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.
One of the problems is that __builtin_bswap is relatively new. I think
it has been added with 4.3. So you again would need lovely GCC version
checks around it.
Bye,
-Andreas-