[PowerPC] Add assembler parser
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 3 May 2013 19:49:39 +0000 (19:49 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 3 May 2013 19:49:39 +0000 (19:49 +0000)
commit5e220753ff81ac5cbee874e7c00c76c7fbe0d20a
treed88d5e639841ab47d78e3fb9b0af0f75417723ae
parent968d689ec30a0df63d252b8193664e01944edb8b
[PowerPC] Add assembler parser

This adds assembler parser support to the PowerPC back end.

The parser will run for any powerpc-*-* and powerpc64-*-* triples,
but was tested only on 64-bit Linux.  The supported syntax is
intended to be compatible with the GNU assembler.

The parser does not yet support all PowerPC instructions, but
it does support anything that is generated by LLVM itself.
There is no support for testing restricted instruction sets yet,
i.e. the parser will always accept any instructions it knows,
no matter what feature flags are given.

Instruction operands will be checked for validity and errors
generated.  (Error handling in general could still be improved.)

The patch adds a number of test cases to verify instruction
and operand encodings.  The tests currently cover all instructions
from the following PowerPC ISA v2.06 Book I facilities:
Branch, Fixed-point, Floating-Point, and Vector.
Note that a number of these instructions are not yet supported
by the back end; they are marked with FIXME.

A number of follow-on check-ins will add extra features.  When
they are all included, LLVM passes all tests (including bootstrap)
when using clang -cc1as as the system assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181050 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
lib/Target/PowerPC/AsmParser/CMakeLists.txt [new file with mode: 0644]
lib/Target/PowerPC/AsmParser/LLVMBuild.txt [new file with mode: 0644]
lib/Target/PowerPC/AsmParser/Makefile [new file with mode: 0644]
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp [new file with mode: 0644]
lib/Target/PowerPC/CMakeLists.txt
lib/Target/PowerPC/LLVMBuild.txt
lib/Target/PowerPC/Makefile
lib/Target/PowerPC/PPC.td
lib/Target/PowerPC/PPCInstr64Bit.td
lib/Target/PowerPC/PPCInstrInfo.td
test/MC/PowerPC/ppc64-encoding-fp.s [new file with mode: 0644]
test/MC/PowerPC/ppc64-encoding-vmx.s [new file with mode: 0644]
test/MC/PowerPC/ppc64-encoding.s [new file with mode: 0644]
test/MC/PowerPC/ppc64-errors.s [new file with mode: 0644]
test/MC/PowerPC/ppc64-operands.s [new file with mode: 0644]