lkml.org 
[lkml]   [2007]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] Documentation about unaligned memory access
On Fri, Nov 23, 2007 at 12:15:53AM +0000, Daniel Drake wrote:
> Why unaligned access is bad
> ===========================
>
> Most architectures are unable to perform unaligned memory accesses. Any
> unaligned access causes a processor exception.

"Some architectures are unable to perform unaligned memory accesses,
either an exception is generated, or the data
access is silently invalid. In architectures that allow unaligned
access, natural aligned accesses are usually faster than non-aligned."

> In summary: if your code causes unaligned memory accesses to happen, your code
> will not work on some platforms, and will perform *very* badly on others.

*very* -> *slower*

> Natural alignment
> =================

Please move this definition before "Why unaligned access is bad".

Also, it would be nice to have a table of ISAs:

ISA Need Need
natural alignment
alignment by x
--------------------------------------------
m68k No 2
powerpc/ppc Yes Word size
x86 No No
x86_64 No No

--
Heikki Orsila Barbie's law:
heikki.orsila@iki.fi "Math is hard, let's go shopping!"
http://www.iki.fi/shd
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-23 12:45    [W:0.429 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site