summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-08-31 17:03:33 +0000
committerDale Johannesen <dalej@apple.com>2007-08-31 17:03:33 +0000
commitda7469f2b5616e49d05c59fb3df0eaf179748207 (patch)
tree1a2d67489eee659b99ddea26e235b28967b0af2b /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent9fca6dfad3597d6116a19f35f5e2d60087cf1f5a (diff)
downloadbcm5719-llvm-da7469f2b5616e49d05c59fb3df0eaf179748207.tar.gz
bcm5719-llvm-da7469f2b5616e49d05c59fb3df0eaf179748207.zip
Revise per review of previous patch.
llvm-svn: 41645
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index f4ee33f36ab..156c73959f7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -979,20 +979,32 @@ SDOperand SelectionDAG::FoldSetCC(MVT::ValueType VT, SDOperand N1,
APFloat::cmpResult R = N1C->getValueAPF().compare(N2C->getValueAPF());
switch (Cond) {
default: break;
- case ISD::SETOEQ:
- case ISD::SETEQ: return getConstant(R==APFloat::cmpEqual, VT);
- case ISD::SETONE:
- case ISD::SETNE: return getConstant(R==APFloat::cmpGreaterThan ||
+ case ISD::SETEQ: if (R==APFloat::cmpUnordered)
+ return getNode(ISD::UNDEF, VT);
+ // fall through
+ case ISD::SETOEQ: return getConstant(R==APFloat::cmpEqual, VT);
+ case ISD::SETNE: if (R==APFloat::cmpUnordered)
+ return getNode(ISD::UNDEF, VT);
+ // fall through
+ case ISD::SETONE: return getConstant(R==APFloat::cmpGreaterThan ||
R==APFloat::cmpLessThan, VT);
- case ISD::SETOLT:
- case ISD::SETLT: return getConstant(R==APFloat::cmpLessThan, VT);
- case ISD::SETOGT:
- case ISD::SETGT: return getConstant(R==APFloat::cmpGreaterThan, VT);
- case ISD::SETOLE:
- case ISD::SETLE: return getConstant(R==APFloat::cmpLessThan ||
+ case ISD::SETLT: if (R==APFloat::cmpUnordered)
+ return getNode(ISD::UNDEF, VT);
+ // fall through
+ case ISD::SETOLT: return getConstant(R==APFloat::cmpLessThan, VT);
+ case ISD::SETGT: if (R==APFloat::cmpUnordered)
+ return getNode(ISD::UNDEF, VT);
+ // fall through
+ case ISD::SETOGT: return getConstant(R==APFloat::cmpGreaterThan, VT);
+ case ISD::SETLE: if (R==APFloat::cmpUnordered)
+ return getNode(ISD::UNDEF, VT);
+ // fall through
+ case ISD::SETOLE: return getConstant(R==APFloat::cmpLessThan ||
R==APFloat::cmpEqual, VT);
- case ISD::SETOGE:
- case ISD::SETGE: return getConstant(R==APFloat::cmpGreaterThan ||
+ case ISD::SETGE: if (R==APFloat::cmpUnordered)
+ return getNode(ISD::UNDEF, VT);
+ // fall through
+ case ISD::SETOGE: return getConstant(R==APFloat::cmpGreaterThan ||
R==APFloat::cmpEqual, VT);
case ISD::SETO: return getConstant(R!=APFloat::cmpUnordered, VT);
case ISD::SETUO: return getConstant(R==APFloat::cmpUnordered, VT);
OpenPOWER on IntegriCloud