summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp b/llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
index 15a28f22ab8..21943a902d7 100644
--- a/llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
@@ -187,6 +187,10 @@ public:
SDOperand Select(SDOperand Op);
+ // Complex Pattern Selectors.
+ bool SelectADDRrr(SDOperand N, SDOperand &R1, SDOperand &R2);
+ bool SelectADDRri(SDOperand N, SDOperand &Base, SDOperand &Offset);
+
/// InstructionSelectBasicBlock - This callback is invoked by
/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
virtual void InstructionSelectBasicBlock(SelectionDAG &DAG);
@@ -214,6 +218,22 @@ void SparcV8DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
ScheduleAndEmitDAG(DAG);
}
+bool SparcV8DAGToDAGISel::SelectADDRrr(SDOperand N, SDOperand &R1,
+ SDOperand &R2) {
+ // FIXME: This should obviously be smarter.
+ R1 = Select(N);
+ R2 = CurDAG->getRegister(V8::G0, MVT::i32);
+ return true;
+}
+
+bool SparcV8DAGToDAGISel::SelectADDRri(SDOperand N, SDOperand &Base,
+ SDOperand &Offset) {
+ // FIXME: This should obviously be smarter.
+ Base = Select(N);
+ Offset = CurDAG->getTargetConstant(0, MVT::i32);
+ return true;
+}
+
SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) {
SDNode *N = Op.Val;
OpenPOWER on IntegriCloud