Grant Edwards wrote:

(*) In the illustrated case (earlier) that would seem to be
   two mov.b instructions to shift a single 16-bit misaligned
   quantity.

Except it's not a single 16-bit misaligned quantity.  It's two
properly aligned single byte quantities.  The compiler decided
to combine the two byte operations into a word operation even
though one of the addresses was odd.
Two mov.b instruction is perfect.  It's exactly what the source
specified.

Point taken. It's an optimiser issue in this case. The optimiser has to know that one mov.w isn't equivalent to a pair of mov.b instructions in this case.

A thought... is it a valid optimisation to replace a routine like 'memcpy', assuming that 'memcpy' is the one from <stdio.h>? What if the user wrote his own 'memcpy' routine to do something magic and then wondered why it didn't get called?

Steve.

Reply via email to