[PowerPC] Add support for the CMPB instruction
authorHal Finkel <hfinkel@anl.gov>
Sat, 3 Jan 2015 01:16:37 +0000 (01:16 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 3 Jan 2015 01:16:37 +0000 (01:16 +0000)
commit958b670c3404071548deb75df55c0b8a1a6e3e13
tree42b53ed46ae3195ef6f8ca7b8c1a2834adcb808f
parent8c6ae1044afc4c7fdad845a037a9de84e98bf9bc
[PowerPC] Add support for the CMPB instruction

Newer POWER cores, and the A2, support the cmpb instruction. This instruction
compares its operands, treating each of the 8 bytes in the GPRs separately,
returning a 'mask' result of 0 (for false) or -1 (for true) in each byte.

Code generation support is added, in the form of a PPCISelDAGToDAG
DAG-preprocessing routine, that recognizes patterns close to what the
instruction computes (either exactly, or related by a constant masking
operation), and generates the cmpb instruction (along with any necessary
constant masking operation). This can be expanded if use cases arise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225106 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
lib/Target/PowerPC/PPC.td
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/PowerPC/PPCInstr64Bit.td
lib/Target/PowerPC/PPCInstrInfo.td
lib/Target/PowerPC/PPCSubtarget.cpp
lib/Target/PowerPC/PPCSubtarget.h
test/CodeGen/PowerPC/cmpb-ppc32.ll [new file with mode: 0644]
test/CodeGen/PowerPC/cmpb.ll [new file with mode: 0644]
test/MC/Disassembler/PowerPC/ppc64-encoding.txt
test/MC/PowerPC/ppc64-encoding.s