This change implements the transformation in processInstruction() for the LDR rt, =expression to MOV rt, expression when the expression can be evaluated and can fit into the immediate field of the MOV or a MVN.
Across the ARM and Thumb instruction sets there are several cases to consider, each with a different range of representatble constants.
In ARM we have:
- Modified immediate (All ARM architectures)
- MOVW (v6t2 and above)
In Thumb we have:
- Modified immediate (v6t2, v7m and v8m.mainline)
- MOVW (v6t2, v7m, v8.mainline and v8m.baseline)
- Narrow Thumb MOV that can be used in an IT block (non flag-setting)
If the immediate fits any of the available alternatives then we make the transformation.
Fixes 25722.
ARM::MOVi16's actual predicate is "[IsARM, HasV6T2]". It's probably an academic distinction, but checking for v8m in ARM-mode code looks weird.