[PowerPC] Fix and improve vector comparisons
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 4 Aug 2014 13:13:57 +0000 (13:13 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 4 Aug 2014 13:13:57 +0000 (13:13 +0000)
commit3b7a193521b60d769fb1949f1d8618d7dc592cb7
tree3fc066931bf5be74387f9af698d423ae29d1b8f8
parent98b419bff75f6c85d76727b222103d5c69de6b89
[PowerPC] Fix and improve vector comparisons

This patch refactors code generation of vector comparisons.

This fixes a wrong code-gen bug for ISD::SETGE for floating-point types,
and improves generated code for vector comparisons in general.

Specifically, the patch moves all logic deciding how to implement vector
comparisons into getVCmpInst, which gets two extra boolean outputs
indicating to its caller whether its needs to swap the input operands
and/or negate the result of the comparison.  Apart from implementing
these two modifications as directed by getVCmpInst, there is no need
to ever implement vector comparisons in any other manner; in particular,
there is never a need to perform two separate comparisons (e.g. one for
equal and one for greater-than, as code used to do before this patch).

Reviewed by Bill Schmidt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214714 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/vec_cmp.ll