@@ -67,6 +67,10 @@ class XtensaMCCodeEmitter : public MCCodeEmitter {
6767 SmallVectorImpl<MCFixup> &Fixups,
6868 const MCSubtargetInfo &STI) const ;
6969
70+ uint32_t getLoopTargetEncoding (const MCInst &MI, unsigned int OpNum,
71+ SmallVectorImpl<MCFixup> &Fixups,
72+ const MCSubtargetInfo &STI) const ;
73+
7074 uint32_t getCallEncoding (const MCInst &MI, unsigned int OpNum,
7175 SmallVectorImpl<MCFixup> &Fixups,
7276 const MCSubtargetInfo &STI) const ;
@@ -219,6 +223,23 @@ uint32_t XtensaMCCodeEmitter::getBranchTargetEncoding(
219223 }
220224}
221225
226+ uint32_t
227+ XtensaMCCodeEmitter::getLoopTargetEncoding (const MCInst &MI, unsigned int OpNum,
228+ SmallVectorImpl<MCFixup> &Fixups,
229+ const MCSubtargetInfo &STI) const {
230+ const MCOperand &MO = MI.getOperand (OpNum);
231+ if (MO.isImm ())
232+ return static_cast <uint32_t >(MO.getImm ());
233+
234+ assert ((MO.isExpr ()) && " Unexpected operand value!" );
235+
236+ const MCExpr *Expr = MO.getExpr ();
237+
238+ Fixups.push_back (MCFixup::create (
239+ 0 , Expr, MCFixupKind (Xtensa::fixup_xtensa_loop_8), MI.getLoc ()));
240+ return 0 ;
241+ }
242+
222243uint32_t
223244XtensaMCCodeEmitter::getCallEncoding (const MCInst &MI, unsigned int OpNum,
224245 SmallVectorImpl<MCFixup> &Fixups,
0 commit comments