52 virtual bool SelectInlineAsmMemoryOperand(
const SDValue &Op,
54 std::vector<SDValue> &OutOps);
56 virtual const char *getPassName()
const {
57 return "SPARC DAG->DAG Pattern Instruction Selection";
61 #include "SparcGenDAGISel.inc"
64 SDNode* getGlobalBaseReg();
68 SDNode* SparcDAGToDAGISel::getGlobalBaseReg() {
70 return CurDAG->getRegister(GlobalBaseReg,
71 getTargetLowering()->getPointerTy()).getNode();
74 bool SparcDAGToDAGISel::SelectADDRri(
SDValue Addr,
77 Base = CurDAG->getTargetFrameIndex(FIN->getIndex(),
78 getTargetLowering()->getPointerTy());
79 Offset = CurDAG->getTargetConstant(0,
MVT::i32);
89 if (isInt<13>(CN->getSExtValue())) {
91 dyn_cast<FrameIndexSDNode>(Addr.
getOperand(0))) {
93 Base = CurDAG->getTargetFrameIndex(FIN->getIndex(),
94 getTargetLowering()->getPointerTy());
98 Offset = CurDAG->getTargetConstant(CN->getZExtValue(),
MVT::i32);
114 Offset = CurDAG->getTargetConstant(0,
MVT::i32);
127 if (isInt<13>(CN->getSExtValue()))
138 R2 = CurDAG->getRegister(SP::G0, getTargetLowering()->getPointerTy());
152 return getGlobalBaseReg();
166 TopPart =
SDValue(CurDAG->getMachineNode(SP::SRAri, dl,
MVT::i32, DivLHS,
167 CurDAG->getTargetConstant(31,
MVT::i32)), 0);
169 TopPart = CurDAG->getRegister(SP::G0,
MVT::i32);
172 CurDAG->getRegister(SP::G0,
MVT::i32)), 0);
176 return CurDAG->SelectNodeTo(N, Opcode,
MVT::i32, DivLHS, DivRHS,
192 return SelectCode(N);
199 SparcDAGToDAGISel::SelectInlineAsmMemoryOperand(
const SDValue &Op,
201 std::vector<SDValue> &OutOps) {
203 switch (ConstraintCode) {
204 default:
return true;
206 if (!SelectADDRrr(Op, Op0, Op1))
207 SelectADDRri(Op, Op0, Op1);
211 OutOps.push_back(Op0);
212 OutOps.push_back(Op1);
220 return new SparcDAGToDAGISel(TM);
unsigned getOpcode() const
const SDValue & getOperand(unsigned Num) const
void setNodeId(int Id)
setNodeId - Set unique node id.
EVT getValueType(unsigned ResNo) const
Simple integer binary arithmetic operators.
const SDValue & getOperand(unsigned i) const
unsigned getOpcode() const
FunctionPass * createSparcISelDag(SparcTargetMachine &TM)
bool isMachineOpcode() const