OSDN Git Service

[PowerPC] Support asm parsing for bc[l][a][+-] mnemonics
authorHal Finkel <hfinkel@anl.gov>
Sat, 3 Sep 2016 02:31:44 +0000 (02:31 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 3 Sep 2016 02:31:44 +0000 (02:31 +0000)
commitf86e7eec6548b530b57d038eb1535e999d87f0f7
treed0b0ecb2c33ec968f9f15f13ac6c58cf769cb5ad
parent0d65f1da0e11b139d7bc04bddb69bb57a2ad7586
[PowerPC] Support asm parsing for bc[l][a][+-] mnemonics

PowerPC assembly code in the wild, so it seems, has things like this:

  bc+     12, 28, .L9

This is a bit odd because the '+' here becomes part of the BO field, and the BO
field is otherwise the first operand. Nevertheless, the ISA specification does
clearly say that the +- hint syntax applies to all conditional-branch mnemonics
(that test either CTR or a condition register, although not the forms which
check both), both basic and extended, so this is supposed to be valid.

This introduces some asm-parser-only definitions which take only the upper
three bits from the specified BO value, and the lower two bits are implied by
the +- suffix (via some associated aliases).

Fixes PR23646.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280571 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h
lib/Target/PowerPC/PPCInstrFormats.td
lib/Target/PowerPC/PPCInstrInfo.td
test/MC/PowerPC/ppc64-encoding.s