OSDN Git Service

[ARM] Tighten restrictions on use of SP in v8.1-M CSEL.
authorSimon Tatham <simon.tatham@arm.com>
Thu, 27 Jun 2019 12:40:40 +0000 (12:40 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Thu, 27 Jun 2019 12:40:40 +0000 (12:40 +0000)
commitdbfb2af6216ba1bddf5a3160c0f6cf1cedb5effb
tree710b43610657e55911c5f14ded444e54721219b0
parent98ce5f9f8c727d96a7f612670733101f55059891
[ARM] Tighten restrictions on use of SP in v8.1-M CSEL.

In the `CSEL Rd,Rm,Rn` instruction family (also including CSINC, CSINV
and CSNEG), the architecture lists it as CONSTRAINED UNPREDICTABLE
(i.e. SoftFail) to use SP in the Rd or Rm slot, but outright illegal
to use it in the Rn slot, not least because some encodings of that
form are used by MVE instructions such as UQRSHLL.

MC was treating all three slots the same, as SoftFail. So the only
reason UQRSHLL was disassembled correctly at all was because the MVE
decode table is separate from the Thumb2 one and takes priority; if
you turned off MVE, then encodings such as `[0x5f,0xea,0x0d,0x83]`
would disassemble as spurious CSELs.

Fixed by inventing another version of the `GPRwithZR` register class,
which disallows SP completely instead of just SoftFailing it.

Reviewers: DavidSpickett, ostannard

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63862

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364531 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMInstrThumb2.td
lib/Target/ARM/ARMRegisterInfo.td
lib/Target/ARM/Disassembler/ARMDisassembler.cpp
test/MC/Disassembler/ARM/mve-scalar-shift.txt
test/MC/Disassembler/ARM/thumbv8.1m.s