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
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.