Re: get/put unaligned helpers

From: Boaz Harrosh
Date: Thu Feb 12 2009 - 07:55:54 EST


Maciej W. Rozycki wrote:
> On Thu, 12 Feb 2009, Boaz Harrosh wrote:
>
>> Speaking of which. When all this is done do you intend to also export
>> the unaligned.h headers to user-mode just like the aligned Endian helpers?
>>
>> That could help in a couple of projects, so you have my vote.
>
> Why would you need that? GCC provides a portable, platform-independent
> way. It has had it for ten years at the very least.
>

Do you mean the __built_in_swabXX() and all these guys.

I was under the impression they need to be aligned because otherwise that means
something is done wrong. Because the aligned version on lots of CPUs is one instruction
where unaligned access is better, or must, be emulated (byte accessed).

Assembly wise the two accesses are different and sometimes the compiler has no way to
know, where the programmer can know for sure.

But I like to be educated any day, please explain what to use when.

> Maciej

Thanks
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/