[llvm-commits] [llvm] r41645 - in /llvm/trunk: include/llvm/ADT/StringExtras.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/IA64/IA64ISelDAGToDAG.cpp
Dale Johannesen
dalej at apple.com
Fri Aug 31 10:03:33 PDT 2007
Author: johannes
Date: Fri Aug 31 12:03:33 2007
New Revision: 41645
URL: http://llvm.org/viewvc/llvm-project?rev=41645&view=rev
Log:
Revise per review of previous patch.
Modified:
llvm/trunk/include/llvm/ADT/StringExtras.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp
Modified: llvm/trunk/include/llvm/ADT/StringExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringExtras.h?rev=41645&r1=41644&r2=41645&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringExtras.h (original)
+++ llvm/trunk/include/llvm/ADT/StringExtras.h Fri Aug 31 12:03:33 2007
@@ -93,7 +93,7 @@
return B;
}
-static inline std::string ftostr(APFloat V) {
+static inline std::string ftostr(const APFloat& V) {
if (&V.getSemantics() == &APFloat::IEEEsingle)
return ftostr(V.convertToDouble());
else if (&V.getSemantics() == &APFloat::IEEEdouble)
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=41645&r1=41644&r2=41645&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Aug 31 12:03:33 2007
@@ -979,20 +979,32 @@
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);
Modified: llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp?rev=41645&r1=41644&r2=41645&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp Fri Aug 31 12:03:33 2007
@@ -404,9 +404,11 @@
SDOperand Chain = CurDAG->getEntryNode(); // this is a constant, so..
SDOperand V;
- if (cast<ConstantFPSDNode>(N)->getValueAPF().isPosZero()) {
+ ConstantFPSDNode* N2 = cast<ConstantFPSDNode>(N);
+ if (N2->getValueAPF().isPosZero()) {
V = CurDAG->getCopyFromReg(Chain, IA64::F0, MVT::f64);
- } else if (cast<ConstantFPSDNode>(N)->isExactlyValue(APFloat(+1.0))) {
+ } else if (N2->isExactlyValue(N2->getValueType(0) == MVT::f32 ?
+ APFloat(+1.0f) : APFloat(+1.0))) {
V = CurDAG->getCopyFromReg(Chain, IA64::F1, MVT::f64);
} else
assert(0 && "Unexpected FP constant!");
More information about the llvm-commits
mailing list