This is the mail archive of the gcc@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: Endian swapping with C code on ARM


Giovanni Bajo wrote:

Robert Dewar wrote:


Wouldn't it be a good idea to have a built-in for endian
swapping. Many architectures have specialized instructions
or effective sequences for this common operation.


Agreed. A builtin and some magic to recognize common shift/or sequences to do
that manually, so that it can optimized to the builtin.

I am a bit dubious about "common shift/or sequences", since there are many equivalent ways to code this manually. I rather dislike fragile code that conforms to some particular pattern "knowing" that the compiler will recognize it.


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