Home | History | Annotate | Download | only in MSP430

Lines Matching defs:AM

102     bool MatchAddress(SDValue N, MSP430ISelAddressMode &AM);
103 bool MatchWrapper(SDValue N, MSP430ISelAddressMode &AM);
104 bool MatchAddressBase(SDValue N, MSP430ISelAddressMode &AM);
134 bool MSP430DAGToDAGISel::MatchWrapper(SDValue N, MSP430ISelAddressMode &AM) {
137 if (AM.hasSymbolicDisplacement())
143 AM.GV = G->getGlobal();
144 AM.Disp += G->getOffset();
145 //AM.SymbolFlags = G->getTargetFlags();
147 AM.CP = CP->getConstVal();
148 AM.Align = CP->getAlignment();
149 AM.Disp += CP->getOffset();
150 //AM.SymbolFlags = CP->getTargetFlags();
152 AM.ES = S->getSymbol();
153 //AM.SymbolFlags = S->getTargetFlags();
155 AM.JT = J->getIndex();
156 //AM.SymbolFlags = J->getTargetFlags();
158 AM.BlockAddr = cast<BlockAddressSDNode>(N0)->getBlockAddress();
159 //AM.SymbolFlags = cast<BlockAddressSDNode>(N0)->getTargetFlags();
166 bool MSP430DAGToDAGISel::MatchAddressBase(SDValue N, MSP430ISelAddressMode &AM) {
168 if (AM.BaseType != MSP430ISelAddressMode::RegBase || AM.Base.Reg.getNode()) {
174 AM.BaseType = MSP430ISelAddressMode::RegBase;
175 AM.Base.Reg = N;
179 bool MSP430DAGToDAGISel::MatchAddress(SDValue N, MSP430ISelAddressMode &AM) {
180 DEBUG(errs() << "MatchAddress: "; AM.dump());
186 AM.Disp += Val;
191 if (!MatchWrapper(N, AM))
196 if (AM.BaseType == MSP430ISelAddressMode::RegBase
197 && AM.Base.Reg.getNode() == nullptr) {
198 AM.BaseType = MSP430ISelAddressMode::FrameIndexBase;
199 AM.Base.FrameIndex = cast<FrameIndexSDNode>(N)->getIndex();
205 MSP430ISelAddressMode Backup = AM;
206 if (!MatchAddress(N.getNode()->getOperand(0), AM) &&
207 !MatchAddress(N.getNode()->getOperand(1), AM))
209 AM = Backup;
210 if (!MatchAddress(N.getNode()->getOperand(1), AM) &&
211 !MatchAddress(N.getNode()->getOperand(0), AM))
213 AM = Backup;
221 MSP430ISelAddressMode Backup = AM;
224 if (!MatchAddress(N.getOperand(0), AM) &&
226 AM.GV == nullptr &&
229 AM.Disp += Offset;
232 AM = Backup;
237 return MatchAddressBase(N, AM);
245 MSP430ISelAddressMode AM;
247 if (MatchAddress(N, AM))
251 if (AM.BaseType == MSP430ISelAddressMode::RegBase) {
252 if (!AM.Base.Reg.getNode())
253 AM.Base.Reg = CurDAG->getRegister(0, VT);
256 Base = (AM.BaseType == MSP430ISelAddressMode::FrameIndexBase)
258 AM.Base.FrameIndex,
260 : AM.Base.Reg;
262 if (AM.GV)
263 Disp = CurDAG->getTargetGlobalAddress(AM.GV, SDLoc(N),
264 MVT::i16, AM.Disp,
265 0/*AM.SymbolFlags*/);
266 else if (AM.CP)
267 Disp = CurDAG->getTargetConstantPool(AM.CP, MVT::i16,
268 AM.Align, AM.Disp, 0/*AM.SymbolFlags*/);
269 else if (AM.ES)
270 Disp = CurDAG->getTargetExternalSymbol(AM.ES, MVT::i16, 0/*AM.SymbolFlags*/);
271 else if (AM.JT != -1)
272 Disp = CurDAG->getTargetJumpTable(AM.JT, MVT::i16, 0/*AM.SymbolFlags*/);
273 else if (AM.BlockAddr)
274 Disp = CurDAG->getTargetBlockAddress(AM.BlockAddr, MVT::i32, 0,
275 0/*AM.SymbolFlags*/);
277 Disp = CurDAG->getTargetConstant(AM.Disp, SDLoc(N), MVT::i16);
300 ISD::MemIndexedMode AM = LD->getAddressingMode();
301 if (AM != ISD::POST_INC || LD->getExtensionType() != ISD::NON_EXTLOAD)