PR12716: PPC crashes on vector compare
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Mon, 8 Oct 2012 18:59:53 +0000 (18:59 +0000)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Mon, 8 Oct 2012 18:59:53 +0000 (18:59 +0000)
commit1c7d69bbe2de22f386ffd9ef4480f8a77be28130
tree0131d3805f3b5779497d9be937290f0456454858
parent39817f9d393fdc29ec35fc8626d8b372415df414
PR12716: PPC crashes on vector compare

Vector compare using altivec 'vcmpxxx' instructions have as third argument
a vector register instead of CR one, different from integer and float-point
compares. This leads to a failure in code generation, where 'SelectSETCC'
expects a DAG with a CR register and gets vector register instead.

This patch changes the behavior by just returning a DAG with the
vector compare instruction based on the type. The patch also adds a testcase
for all vector types llvm defines.

It also included a fix on signed 5-bits predicates printing, where
signed values were not handled correctly as signed (char are unsigned by
default for PowerPC). This generates 'vspltisw' (vector splat)
instruction with SIM out of range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165419 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/vec_cmp.ll [new file with mode: 0644]