[ARM] Fix Asm/Disasm of TBB/TBH instructions
authorDavid Spickett <david.spickett@linaro.org>
Thu, 16 Jul 2020 14:29:28 +0000 (15:29 +0100)
committerDavid Spickett <david.spickett@linaro.org>
Wed, 22 Jul 2020 08:31:56 +0000 (09:31 +0100)
commit3a3419460647612fba9dbecbd770fc8c84bbc05a
treeebab7a3b137ac93ae8ace75a72511dafdda159c3
parent54eea6127c4d77db03787b7c55765632fb9a6f1c
[ARM] Fix Asm/Disasm of TBB/TBH instructions

Summary:
This fixes Bugzilla #46616 in which it was reported
that "tbb  [pc, r0]" was marked as SoftFail
(aka unpredictable) incorrectly.

Expected behaviour is:
* ARMv8 is required to use sp as rn or rm
  (tbb/tbh only have a Thumb encoding so using Arm mode
  is not an option)
* If rm is the pc then the instruction is always
  unpredictable

Some of this was implemented already and this fixes the
rest. Added tests cover the new and pre-existing handling.

Reviewers: ostannard

Reviewed By: ostannard

Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D84227
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/test/MC/ARM/thumb2-diagnostics.s
llvm/test/MC/Disassembler/ARM/thumb2-diagnostic.txt [new file with mode: 0644]