Update alpha to reflect recent constantfp legalize changes. It's not clear
authorChris Lattner <sabre@nondot.org>
Sun, 29 Jan 2006 06:25:22 +0000 (06:25 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Jan 2006 06:25:22 +0000 (06:25 +0000)
why all this code isn't autogenerated. :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25770 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaISelDAGToDAG.cpp
lib/Target/Alpha/AlphaISelLowering.cpp

index 2b83f39bb47090af1ac16883a9d28c29a1e2205b..8405b26ab399041461c696ca8969f09dfb7b88c1 100644 (file)
@@ -237,23 +237,23 @@ SDOperand AlphaDAGToDAGISel::Select(SDOperand Op) {
     return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, 
                                CPI, Tmp, CurDAG->getEntryNode());
   }
-  case ISD::ConstantFP:
-    if (ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N)) {
-      bool isDouble = N->getValueType(0) == MVT::f64;
-      MVT::ValueType T = isDouble ? MVT::f64 : MVT::f32;
-      if (CN->isExactlyValue(+0.0)) {
-        return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS,
-                                    T, CurDAG->getRegister(Alpha::F31, T),
-                                    CurDAG->getRegister(Alpha::F31, T));
-      } else if ( CN->isExactlyValue(-0.0)) {
-        return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS,
-                                    T, CurDAG->getRegister(Alpha::F31, T),
-                                    CurDAG->getRegister(Alpha::F31, T));
-      } else {
-        abort();
-      }
-      break;
+  case ISD::TargetConstantFP: {
+    ConstantFPSDNode *CN = cast<ConstantFPSDNode>(N);
+    bool isDouble = N->getValueType(0) == MVT::f64;
+    MVT::ValueType T = isDouble ? MVT::f64 : MVT::f32;
+    if (CN->isExactlyValue(+0.0)) {
+      return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS,
+                                  T, CurDAG->getRegister(Alpha::F31, T),
+                                  CurDAG->getRegister(Alpha::F31, T));
+    } else if ( CN->isExactlyValue(-0.0)) {
+      return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS,
+                                  T, CurDAG->getRegister(Alpha::F31, T),
+                                  CurDAG->getRegister(Alpha::F31, T));
+    } else {
+      abort();
     }
+    break;
+  }
 
   case ISD::SETCC:
     if (MVT::isFloatingPoint(N->getOperand(0).Val->getValueType(0))) {
index 6779b90bd3a69a5aa66a971a0c9d1d72ad65bc6b..517ffaeab6a87f8cfabd7ecde34ef04b295ebaa2 100644 (file)
@@ -145,6 +145,8 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM)
 
   setStackPointerRegisterToSaveRestore(Alpha::R30);
 
+  setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
+  setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
   addLegalFPImmediate(+0.0); //F31
   addLegalFPImmediate(-0.0); //-F31