bufhelp: use unaligned dword and qword types for endianess helpers
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 28 Jan 2017 09:26:02 +0000 (11:26 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 28 Jan 2017 09:26:02 +0000 (11:26 +0200)
commite7b941c3de9c9b6319298c02f844cc0cadbf8562
treecc1d04b5baa189299b23dbb16993fa66f84154af
parent92b4a29d2453712192ced2d7226abc49679dcb1e
bufhelp: use unaligned dword and qword types for endianess helpers

* cipher/bufhelp.h (BUFHELP_UNALIGNED_ACCESS): New, defined
if attributes 'packed', 'aligned' and 'may_alias' are supported.
(BUFHELP_FAST_UNALIGNED_ACCESS): Define if have
BUFHELP_UNALIGNED_ACCESS.
--

Now that compiler is properly told that reads from these types
may do not follow strict-aliasing and may be unaligned, we
enable use of these for all architectures and compiler will
emit more optimized, yet correct, code (for example, use
special unaligned read/write instructions instead of accessing
byte-by-byte).

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/bufhelp.h