• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Target/MSP430/

Lines Matching refs:AM

102     bool MatchAddress(SDValue N, MSP430ISelAddressMode &AM);
103 bool MatchWrapper(SDValue N, MSP430ISelAddressMode &AM);
104 bool MatchAddressBase(SDValue N, MSP430ISelAddressMode &AM);
135 bool MSP430DAGToDAGISel::MatchWrapper(SDValue N, MSP430ISelAddressMode &AM) {
138 if (AM.hasSymbolicDisplacement())
144 AM.GV = G->getGlobal();
145 AM.Disp += G->getOffset();
146 //AM.SymbolFlags = G->getTargetFlags();
148 AM.CP = CP->getConstVal();
149 AM.Alignment = CP->getAlign();
150 AM.Disp += CP->getOffset();
151 //AM.SymbolFlags = CP->getTargetFlags();
153 AM.ES = S->getSymbol();
154 //AM.SymbolFlags = S->getTargetFlags();
156 AM.JT = J->getIndex();
157 //AM.SymbolFlags = J->getTargetFlags();
159 AM.BlockAddr = cast<BlockAddressSDNode>(N0)->getBlockAddress();
160 //AM.SymbolFlags = cast<BlockAddressSDNode>(N0)->getTargetFlags();
167 bool MSP430DAGToDAGISel::MatchAddressBase(SDValue N, MSP430ISelAddressMode &AM) {
169 if (AM.BaseType != MSP430ISelAddressMode::RegBase || AM.Base.Reg.getNode()) {
175 AM.BaseType = MSP430ISelAddressMode::RegBase;
176 AM.Base.Reg = N;
180 bool MSP430DAGToDAGISel::MatchAddress(SDValue N, MSP430ISelAddressMode &AM) {
181 LLVM_DEBUG(errs() << "MatchAddress: "; AM.dump());
187 AM.Disp += Val;
192 if (!MatchWrapper(N, AM))
197 if (AM.BaseType == MSP430ISelAddressMode::RegBase
198 && AM.Base.Reg.getNode() == nullptr) {
199 AM.BaseType = MSP430ISelAddressMode::FrameIndexBase;
200 AM.Base.FrameIndex = cast<FrameIndexSDNode>(N)->getIndex();
206 MSP430ISelAddressMode Backup = AM;
207 if (!MatchAddress(N.getNode()->getOperand(0), AM) &&
208 !MatchAddress(N.getNode()->getOperand(1), AM))
210 AM = Backup;
211 if (!MatchAddress(N.getNode()->getOperand(1), AM) &&
212 !MatchAddress(N.getNode()->getOperand(0), AM))
214 AM = Backup;
222 MSP430ISelAddressMode Backup = AM;
225 if (!MatchAddress(N.getOperand(0), AM) &&
227 AM.GV == nullptr &&
230 AM.Disp += Offset;
233 AM = Backup;
238 return MatchAddressBase(N, AM);
246 MSP430ISelAddressMode AM;
248 if (MatchAddress(N, AM))
251 if (AM.BaseType == MSP430ISelAddressMode::RegBase)
252 if (!AM.Base.Reg.getNode())
253 AM.Base.Reg = CurDAG->getRegister(MSP430::SR, MVT::i16);
255 Base = (AM.BaseType == MSP430ISelAddressMode::FrameIndexBase)
257 AM.Base.FrameIndex,
259 : AM.Base.Reg;
261 if (AM.GV)
262 Disp = CurDAG->getTargetGlobalAddress(AM.GV, SDLoc(N),
263 MVT::i16, AM.Disp,
264 0/*AM.SymbolFlags*/);
265 else if (AM.CP)
266 Disp = CurDAG->getTargetConstantPool(AM.CP, MVT::i16, AM.Alignment, AM.Disp,
267 0 /*AM.SymbolFlags*/);
268 else if (AM.ES)
269 Disp = CurDAG->getTargetExternalSymbol(AM.ES, MVT::i16, 0/*AM.SymbolFlags*/);
270 else if (AM.JT != -1)
271 Disp = CurDAG->getTargetJumpTable(AM.JT, MVT::i16, 0/*AM.SymbolFlags*/);
272 else if (AM.BlockAddr)
273 Disp = CurDAG->getTargetBlockAddress(AM.BlockAddr, MVT::i32, 0,
274 0/*AM.SymbolFlags*/);
276 Disp = CurDAG->getTargetConstant(AM.Disp, SDLoc(N), MVT::i16);
299 ISD::MemIndexedMode AM = LD->getAddressingMode();
300 if (AM != ISD::POST_INC || LD->getExtensionType() != ISD::NON_EXTLOAD)