[PowerPC] Handle base load with reservation mnemonic
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 3 Dec 2021 12:56:29 +0000 (06:56 -0600)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 3 Dec 2021 15:13:02 +0000 (09:13 -0600)
commitd6c0ef78876dc3204b0a6d92119b15aa9cd12af3
tree590940b225cc11b9c068bb75b304a050c01ae865
parent72750f00121eb10f27ccd62270e5695d9e3322a5
[PowerPC] Handle base load with reservation mnemonic

The Power ISA defined l[bhwdq]arx as both base and
extended mnemonics. The base mnemonic takes the EH
bit as an operand and the extended mnemonic omits
it, making it implicitly zero. The existing
implementation only handles the base mnemonic when
EH is 1 and internally produces a different
instruction. There are historical reasons for this.
This patch simply removes the limitation introduced
by this implementation that disallows the base
mnemonic with EH = 0 in the ASM parser.

This resolves an issue that prevented some files
in the Linux kernel from being built with
-fintegrated-as.

Also fix a crash if the value is not an integer immediate.
llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
llvm/test/CodeGen/PowerPC/inline-asm-label.ll
llvm/test/MC/PowerPC/ppc64-encoding-bookII.s
llvm/test/MC/PowerPC/ppc64-errors.s