aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-12-12 17:43:52 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-12-12 17:43:52 +0000
commit361f45a5572e8be309fa71c6f677ac4e4233ea04 (patch)
tree98b01ea7cc5b7392fd84b6e0a4809719fb631111
parenta188894d67a3cc2516b25aae9b3cbdbff4b0babe (diff)
restore a more restricted select
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24668 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/Alpha/AlphaISelDAGToDAG.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
index 065cb11f36..e7df9d60af 100644
--- a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
+++ b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
@@ -401,6 +401,38 @@ SDOperand AlphaDAGToDAGISel::Select(SDOperand Op) {
}
break;
+ case ISD::SELECT:
+ if (MVT::isFloatingPoint(N->getValueType(0)) &&
+ (N->getOperand(0).getOpcode() != ISD::SETCC ||
+ !MVT::isFloatingPoint(N->getOperand(0).getOperand(1).getValueType()))) {
+ //This should be the condition not covered by the Patterns
+ //FIXME: Don't have SelectCode die, but rather return something testable
+ // so that things like this can be caught in fall though code
+ //move int to fp
+ bool isDouble = N->getValueType(0) == MVT::f64;
+ SDOperand LD,
+ cond = Select(N->getOperand(0)),
+ TV = Select(N->getOperand(1)),
+ FV = Select(N->getOperand(2));
+
+ if (AlphaLowering.hasITOF()) {
+ LD = CurDAG->getNode(AlphaISD::ITOFT_, MVT::f64, cond);
+ } else {
+ int FrameIdx =
+ CurDAG->getMachineFunction().getFrameInfo()->CreateStackObject(8, 8);
+ SDOperand FI = CurDAG->getFrameIndex(FrameIdx, MVT::i64);
+ SDOperand ST = CurDAG->getTargetNode(Alpha::STQ, MVT::Other,
+ cond, FI, CurDAG->getRegister(Alpha::R31, MVT::i64));
+ LD = CurDAG->getTargetNode(Alpha::LDT, MVT::f64, FI,
+ CurDAG->getRegister(Alpha::R31, MVT::i64),
+ ST);
+ }
+ SDOperand FP = CurDAG->getTargetNode(isDouble?Alpha::FCMOVEQT:Alpha::FCMOVEQS,
+ MVT::f64, FV, TV, LD);
+ return FP;
+ }
+ break;
+
}
return SelectCode(Op);