This is an archive of the discontinued LLVM Phabricator instance.

[ARM] ARM mov InstAlias for MOVW lacks HasV6T2
ClosedPublic

Authored by peter.smith on May 11 2016, 6:12 AM.

Details

Summary

The movw instruction is only available in ARM state for V6T2 and above. The MOVi16 instruction has requirement HasV6T2 but the InstAlias for mov rd, imm where the operand is imm0_65535_expr:$imm does not. This means that movw can incorrectly be used in ARMv4 and ARMv5 by writing mov rd, 0x1234. The simple fix is to the requirement HasV6T2 to the InstAlias. Tests added to not-armv4.s.

Diff Detail

Event Timeline

peter.smith retitled this revision from to [ARM] ARM mov InstAlias for MOVW lacks HasV6T2.
peter.smith updated this object.
peter.smith added a subscriber: llvm-commits.
rengolin accepted this revision.May 17 2016, 6:11 AM
rengolin edited edge metadata.

No brainer. LGTM.

This revision is now accepted and ready to land.May 17 2016, 6:11 AM
rengolin closed this revision.May 17 2016, 6:11 AM

Committed in r269761.