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 using the GCC bswap builtin


Hi Andrew(s),

Sure.  I just want to make sure that whatever optimization you've done
actually hits the places where it's important.

Yepp. htons is a good point. Coming from a big endian target it's not the first thing I care about ;) Actually I'm wondering why s390 provides an accelerated bswap version in glibc at all?! But it is probably also useful in other contexts.


Of course there are common byte swap implementations which the bswap pass does not cover. E.g. something like that:

a = (a << 16) | (a >> 16);
a = ((a & 0x00ff00ff) << 8) | ((a & 0xff00ff00) >> 8);

But I'm not sure how important it is. It don't think it occurs very often.

Bye,

-Andreas-


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