ARM: disallow add/sub to sp unless Rn is also sp.
authorTim Northover <tnorthover@apple.com>
Tue, 23 Apr 2019 13:50:13 +0000 (13:50 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 23 Apr 2019 13:50:13 +0000 (13:50 +0000)
commit6af366be8ad3199f715c54e84c779e02bb8c18b8
treecac009ac0d69d139c87e571135751e2ded6aeb92
parenta6be919c9298c3a62e415bd9fac1ad32229be526
ARM: disallow add/sub to sp unless Rn is also sp.

The manual says that Thumb2 add/sub instructions are only allowed to modify sp
if the first source is also sp. This is slightly different from the usual rGPR
restriction since it's context-sensitive, so implement it in C++.

llvm-svn: 358987
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/test/MC/ARM/invalid-addsub.s [new file with mode: 0644]
llvm/test/MC/Disassembler/ARM/invalid-thumbv7.txt