Thumb-1 only allows SP-based LDR and STR to be word-sized, and SP-base LDR, STR, and ADD only allow offsets that are a multiple of 4. Make some changes to better make use of these instructions:
- Use word loads for anyext byte and halfword loads from the stack.
- Enforce 4-byte alignment on objects accessed in this way, to ensure that the offset is valid.
- Do the same for objects whose frame index is used, in order to avoid having to use more than one ADD to generate the frame index.
- Correct how many bits of offset we think AddrModeT1_s has.
- Make the load/store optimizer able to cope with AddrModeT1_s.
- Fiddle with a bunch of tests to cope with the code generation changes that the above all causes, typically where the use of SP-based addressing causes less callee-saved registers to be used and thus saved.