On Sat, 21 Feb 2015 19:17:43 +0100 k...@shike2.com wrote: > > For 32 Bit / 64 Bit machines (assuming int is 32 bit and char is 8 bit). > > Signed, unsigned makes no difference, assuming self-aligned (which is the > > case on x86, x86_64 and ARM):
> If the char is signed you have to do bit sign extension, and for > example transform 0x81 into 0xffffff81. Depend of the processor it > can be done with only one instruction but in anothers you have to > check the upper bit and branch based in its value. If the char is > unsigned you always have to clear the upper bytes, so in the case of > signed the code is longer and non linear (or even worse, the compiler > calls an internal function to do the bit expansion). You are absolutely right, but I was only talking about alignment-issues, not arithmetic matters. Cheers FRIGN -- FRIGN <d...@frign.de>