diff options
Diffstat (limited to 'lib/Target/Sparc/SparcISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/Sparc/SparcISelDAGToDAG.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 15a28f22ab..21943a902d 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.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; |