On Tue, Mar 16, 2010 at 10:04:04PM +0600, Alexey Salmin wrote:
> >> Wow. What for?
> >
> > Well, simply because it is not compiled with strict alignment.  There might 
> > also be some optimization in
> > memory operation that does unaligned accesses.
> 
> I always thought that unaligned access is much slower than aligned
> one. You mean code-size optimizations?

It is, but if you need to choose between doing say an unaligned 32-bit
read access and reading it in 4 8-bit reads and assembling those together,
on many targets that do allow unaligned accesses the former is much faster.
Especially if in most cases the read is actually aligned and only in rare
cases it is unaligned...

        Jakub

Reply via email to