Hi Georg, On Sat, Sep 18, 2021 at 01:49:30PM +0200, Georg Sauthoff wrote: > That means a superfluous cast is removed and aliasing through a uint8_t > pointer is eliminated. Note that uint8_t doesn't have the same > strict-aliasing properties as unsigned char.
Interesting. Out of curiosity, do you have links that explains this? I found these, but these are just discussions: https://stackoverflow.com/questions/16138237/when-is-uint8-t-%E2%89%A0-unsigned-char https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66110 What about rewording the sentence "uint8_t doesn't have the same strict-aliasing properties as unsigned char" to clarify that unsigned char may alias, but uint8_t may not? > Also simplified the loop since a modern C compiler can speed up (i.e. > auto-vectorize) it in a similar way. For example, GCC auto-vectorizes it > for Haswell using AVX registers while halving the number of instructions > in the generated code. > > Signed-off-by: Georg Sauthoff <m...@gms.tf> The patch looks good to me, thanks! Acked-by: Olivier Matz <olivier.m...@6wind.com>