Lines Matching defs:AM

100     bool MatchAddress(SDValue N, MSP430ISelAddressMode &AM);
101 bool MatchWrapper(SDValue N, MSP430ISelAddressMode &AM);
102 bool MatchAddressBase(SDValue N, MSP430ISelAddressMode &AM);
145 bool MSP430DAGToDAGISel::MatchWrapper(SDValue N, MSP430ISelAddressMode &AM) {
148 if (AM.hasSymbolicDisplacement())
154 AM.GV = G->getGlobal();
155 AM.Disp += G->getOffset();
156 //AM.SymbolFlags = G->getTargetFlags();
158 AM.CP = CP->getConstVal();
159 AM.Alignment = CP->getAlign();
160 AM.Disp += CP->getOffset();
161 //AM.SymbolFlags = CP->getTargetFlags();
163 AM.ES = S->getSymbol();
164 //AM.SymbolFlags = S->getTargetFlags();
166 AM.JT = J->getIndex();
167 //AM.SymbolFlags = J->getTargetFlags();
169 AM.BlockAddr = cast<BlockAddressSDNode>(N0)->getBlockAddress();
170 //AM.SymbolFlags = cast<BlockAddressSDNode>(N0)->getTargetFlags();
177 bool MSP430DAGToDAGISel::MatchAddressBase(SDValue N, MSP430ISelAddressMode &AM) {
179 if (AM.BaseType != MSP430ISelAddressMode::RegBase || AM.Base.Reg.getNode()) {
185 AM.BaseType = MSP430ISelAddressMode::RegBase;
186 AM.Base.Reg = N;
190 bool MSP430DAGToDAGISel::MatchAddress(SDValue N, MSP430ISelAddressMode &AM) {
191 LLVM_DEBUG(errs() << "MatchAddress: "; AM.dump());
197 AM.Disp += Val;
202 if (!MatchWrapper(N, AM))
207 if (AM.BaseType == MSP430ISelAddressMode::RegBase
208 && AM.Base.Reg.getNode() == nullptr) {
209 AM.BaseType = MSP430ISelAddressMode::FrameIndexBase;
210 AM.Base.FrameIndex = cast<FrameIndexSDNode>(N)->getIndex();
216 MSP430ISelAddressMode Backup = AM;
217 if (!MatchAddress(N.getNode()->getOperand(0), AM) &&
218 !MatchAddress(N.getNode()->getOperand(1), AM))
220 AM = Backup;
221 if (!MatchAddress(N.getNode()->getOperand(1), AM) &&
222 !MatchAddress(N.getNode()->getOperand(0), AM))
224 AM = Backup;
232 MSP430ISelAddressMode Backup = AM;
235 if (!MatchAddress(N.getOperand(0), AM) &&
237 AM.GV == nullptr &&
240 AM.Disp += Offset;
243 AM = Backup;
248 return MatchAddressBase(N, AM);
256 MSP430ISelAddressMode AM;
258 if (MatchAddress(N, AM))
261 if (AM.BaseType == MSP430ISelAddressMode::RegBase)
262 if (!AM.Base.Reg.getNode())
263 AM.Base.Reg = CurDAG->getRegister(MSP430::SR, MVT::i16);
265 Base = (AM.BaseType == MSP430ISelAddressMode::FrameIndexBase)
267 AM.Base.FrameIndex,
269 : AM.Base.Reg;
271 if (AM.GV)
272 Disp = CurDAG->getTargetGlobalAddress(AM.GV, SDLoc(N),
273 MVT::i16, AM.Disp,
274 0/*AM.SymbolFlags*/);
275 else if (AM.CP)
276 Disp = CurDAG->getTargetConstantPool(AM.CP, MVT::i16, AM.Alignment, AM.Disp,
277 0 /*AM.SymbolFlags*/);
278 else if (AM.ES)
279 Disp = CurDAG->getTargetExternalSymbol(AM.ES, MVT::i16, 0/*AM.SymbolFlags*/);
280 else if (AM.JT != -1)
281 Disp = CurDAG->getTargetJumpTable(AM.JT, MVT::i16, 0/*AM.SymbolFlags*/);
282 else if (AM.BlockAddr)
283 Disp = CurDAG->getTargetBlockAddress(AM.BlockAddr, MVT::i32, 0,
284 0/*AM.SymbolFlags*/);
286 Disp = CurDAG->getTargetConstant(AM.Disp, SDLoc(N), MVT::i16);
309 ISD::MemIndexedMode AM = LD->getAddressingMode();
310 if (AM != ISD::POST_INC || LD->getExtensionType() != ISD::NON_EXTLOAD)