compare doubles

llvm-svn: 30856
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
index 5598733..c27136c 100644
--- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -539,10 +539,10 @@
 static SDOperand GetCMP(ISD::CondCode CC, SDOperand LHS, SDOperand RHS,
                         SelectionDAG &DAG) {
   MVT::ValueType vt = LHS.getValueType();
-  assert(vt == MVT::i32 || vt == MVT::f32);
+  assert(vt == MVT::i32 || vt == MVT::f32 || vt == MVT::f64);
   //Note: unordered floating point compares should use a non throwing
   //compare.
-  bool isUnorderedFloat = vt == MVT::f32 &&
+  bool isUnorderedFloat = (vt == MVT::f32 || vt == MVT::f64) &&
     (CC >= ISD::SETUO && CC <= ISD::SETUNE);
   assert(!isUnorderedFloat && "Unordered float compares are not supported");
 
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.td b/llvm/lib/Target/ARM/ARMInstrInfo.td
index 3371871..45728ac 100644
--- a/llvm/lib/Target/ARM/ARMInstrInfo.td
+++ b/llvm/lib/Target/ARM/ARMInstrInfo.td
@@ -178,6 +178,10 @@
 	               "fcmpes $a, $b",
 		       [(armcmp FPRegs:$a, FPRegs:$b)]>;
 
+def fcmped  : InstARM<(ops DFPRegs:$a, DFPRegs:$b),
+	               "fcmped $a, $b",
+		       [(armcmp DFPRegs:$a, DFPRegs:$b)]>;
+
 // Floating Point Conversion
 // We use bitconvert for moving the data between the register classes.
 // The format conversion is done with ARM specific nodes
diff --git a/llvm/test/Regression/CodeGen/ARM/fpcmp.ll b/llvm/test/Regression/CodeGen/ARM/fpcmp.ll
index 6d9012d..53529bc 100644
--- a/llvm/test/Regression/CodeGen/ARM/fpcmp.ll
+++ b/llvm/test/Regression/CodeGen/ARM/fpcmp.ll
@@ -3,7 +3,9 @@
 ; RUN: llvm-as < %s | llc -march=arm  | grep moveq &&
 ; RUN: llvm-as < %s | llc -march=arm  | grep movgt &&
 ; RUN: llvm-as < %s | llc -march=arm  | grep movge &&
-; RUN: llvm-as < %s | llc -march=arm  | grep movle
+; RUN: llvm-as < %s | llc -march=arm  | grep movle &&
+; RUN: llvm-as < %s | llc -march=arm  | grep fcmpes &&
+; RUN: llvm-as < %s | llc -march=arm  | grep fcmped
 
 int %f1(float %a) {
 entry:
@@ -39,3 +41,10 @@
 	%tmp = cast bool %tmp to int		; <int> [#uses=1]
 	ret int %tmp
 }
+
+int %g1(double %a) {
+entry:
+	%tmp = setlt double %a, 1.000000e+00		; <bool> [#uses=1]
+	%tmp = cast bool %tmp to int		; <int> [#uses=1]
+	ret int %tmp
+}