[ARM] do not consider sp as deprecated for ldm/stm
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Tue, 23 Feb 2021 12:58:03 +0000 (12:58 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Tue, 23 Feb 2021 13:26:18 +0000 (13:26 +0000)
commite1c3bf6afe09851537ff376ab20714dfd5f9649d
tree8385b058fe27375c61acd5ece6112a1e96375914
parentdd2dbf7ee2e5cdf4b794b09f8bb92e2a75e9b802
[ARM] do not consider sp as deprecated for ldm/stm

Early versions of the ARMv7 reference manuals considered the sp register
as a deprecated register for ldm/stm familiy of instructions. However,
later versions such as ARM DDI 0406C.d added a note to the Appendix:

D9.3 Use of the SP as a general-purpose register
Most ARM instructions, unlike Thumb instructions, provide exactly the
same access to the SP as to R0-R12. This means that it is possible to
use the SP as a general-purpose register.  Earlier issues of this manual
deprecated the use of SP in an ARM instruction, in any way that is
deprecated, not permitted, or not possible in the corresponding
Thumb instruction. However, user feedback indicates a number of cases
where these instructions are useful. Therefore, ARM no longer deprecates
these instruction uses.
Also Armv8 manuals no longer consider SP as deprecated register for ldm/
stm A32 instructions.

Furthermore, GNU as also does not print a deprecated warning when using
SP with those instructions.

Drop deprecation warning for pop/ldm/push/stm instructions.

Patch by: Stefan Agner.

Differential Revision: https://reviews.llvm.org/D82692
llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
llvm/test/CodeGen/ARM/deprecated-asm.s
llvm/test/MC/ARM/arm-load-store-multiple-deprecated.s