utils/bits.h: Support compiler magic for unaligned loads and stores.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 26 May 2018 22:29:09 +0000 (23:29 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 26 May 2018 23:02:23 +0000 (00:02 +0100)
commita23bab96cb9eb7a869eb260336e5837e9c63d69b
tree02f6340d3d613b9baea7eda2488771e40c9bc3a9
parent374bb459369d47f598d1b07f6237f24abd0d52c6
utils/bits.h: Support compiler magic for unaligned loads and stores.

Introduce `RAWw' macros to access the raw memory, and implement `LOADwe'
and `STOREwe' in terms of these and `eTOHw'/`HTOew'.

These are remarkably tricky because GCC (I think mistakenly) thinks that
type-based aliasing is applicable when in fact the other type in
question is `unsigned char', which is known to be able to alias
anything.  Hit things with the `may_alias' hammer and hope they quieten
down.
utils/bits.3
utils/bits.h