Aligned addresses are those which are multiples of the access size in question.
- Access of 4 byte words on addresses that are multiple of 4 will be aligned
- Access of 4 bytes from the address (say) 3 will be unaligned access
It is very likely that the _mem2 function which will work also for unaligned accesses will be less optimal to get the correct alignments working in its code. This means that the _mem2 function is likely to be costlier then its _amem2 version.
So, when you need performance (particularly when you know that the access latency is high) it would be prudent to identify when you can use the aligned access. The _amem2 exists for this very purpose -- to give you performance when you know the access is aligned.
When it comes to 2 byte accesses, identifying aligned operations is very simple.
If all the access addresses for the operation are 'even' (that is, their LSB is zero), you have 2-byte alignment. This can be easily checked with,
if (address & 1) // is true
/* we have an odd address; not aligned */
else
/* we have an even address; its aligned to 2-bytes */