Lines Matching refs:MI

30 unsigned CSKYMCCodeEmitter::getOImmOpValue(const MCInst &MI, unsigned Idx,  in getOImmOpValue()  argument
33 const MCOperand &MO = MI.getOperand(Idx); in getOImmOpValue()
39 CSKYMCCodeEmitter::getImmOpValueIDLY(const MCInst &MI, unsigned Idx, in getImmOpValueIDLY() argument
42 const MCOperand &MO = MI.getOperand(Idx); in getImmOpValueIDLY()
50 CSKYMCCodeEmitter::getImmOpValueMSBSize(const MCInst &MI, unsigned Idx, in getImmOpValueMSBSize() argument
53 const MCOperand &MSB = MI.getOperand(Idx); in getImmOpValueMSBSize()
54 const MCOperand &LSB = MI.getOperand(Idx + 1); in getImmOpValueMSBSize()
68 void CSKYMCCodeEmitter::expandJBTF(const MCInst &MI, SmallVectorImpl<char> &CB, in expandJBTF() argument
77 MCInstBuilder(MI.getOpcode() == CSKY::JBT_E ? CSKY::BF16 : CSKY::BT16) in expandJBTF()
78 .addOperand(MI.getOperand(0)) in expandJBTF()
85 .addOperand(MI.getOperand(1)) in expandJBTF()
86 .addOperand(MI.getOperand(2)); in expandJBTF()
88 TmpInst = MCInstBuilder(CSKY::JMPI32).addOperand(MI.getOperand(2)); in expandJBTF()
94 void CSKYMCCodeEmitter::expandNEG(const MCInst &MI, SmallVectorImpl<char> &CB, in expandNEG() argument
100 unsigned Size = MI.getOpcode() == CSKY::NEG32 ? 4 : 2; in expandNEG()
103 .addOperand(MI.getOperand(0)) in expandNEG()
104 .addOperand(MI.getOperand(1)); in expandNEG()
109 .addOperand(MI.getOperand(0)) in expandNEG()
110 .addOperand(MI.getOperand(0)) in expandNEG()
116 void CSKYMCCodeEmitter::expandRSUBI(const MCInst &MI, SmallVectorImpl<char> &CB, in expandRSUBI() argument
122 unsigned Size = MI.getOpcode() == CSKY::RSUBI32 ? 4 : 2; in expandRSUBI()
125 .addOperand(MI.getOperand(0)) in expandRSUBI()
126 .addOperand(MI.getOperand(1)); in expandRSUBI()
131 .addOperand(MI.getOperand(0)) in expandRSUBI()
132 .addOperand(MI.getOperand(0)) in expandRSUBI()
133 .addImm(MI.getOperand(2).getImm() + 1); in expandRSUBI()
138 void CSKYMCCodeEmitter::encodeInstruction(const MCInst &MI, in encodeInstruction() argument
142 const MCInstrDesc &Desc = MII.get(MI.getOpcode()); in encodeInstruction()
147 switch (MI.getOpcode()) { in encodeInstruction()
149 TmpInst = MI; in encodeInstruction()
153 expandJBTF(MI, CB, Fixups, STI); in encodeInstruction()
158 expandNEG(MI, CB, Fixups, STI); in encodeInstruction()
163 expandRSUBI(MI, CB, Fixups, STI); in encodeInstruction()
167 TmpInst = MCInstBuilder(CSKY::BSR32).addOperand(MI.getOperand(0)); in encodeInstruction()
170 TmpInst = MCInstBuilder(CSKY::BR16).addOperand(MI.getOperand(0)); in encodeInstruction()
173 TmpInst = MCInstBuilder(CSKY::BR32).addOperand(MI.getOperand(0)); in encodeInstruction()
177 .addOperand(MI.getOperand(0)) in encodeInstruction()
178 .addOperand(MI.getOperand(1)); in encodeInstruction()
182 .addOperand(MI.getOperand(0)) in encodeInstruction()
183 .addOperand(MI.getOperand(1)); in encodeInstruction()
187 .addOperand(MI.getOperand(0)) in encodeInstruction()
188 .addOperand(MI.getOperand(1)); in encodeInstruction()
192 .addOperand(MI.getOperand(0)) in encodeInstruction()
193 .addOperand(MI.getOperand(1)); in encodeInstruction()
197 .addOperand(MI.getOperand(0)) in encodeInstruction()
198 .addOperand(MI.getOperand(2)); in encodeInstruction()
202 .addOperand(MI.getOperand(0)) in encodeInstruction()
203 .addOperand(MI.getOperand(2)); in encodeInstruction()
207 .addOperand(MI.getOperand(0)) in encodeInstruction()
208 .addOperand(MI.getOperand(1)) in encodeInstruction()
209 .addImm(MI.getOperand(2).getImm() + 1); in encodeInstruction()
213 .addOperand(MI.getOperand(0)) in encodeInstruction()
214 .addOperand(MI.getOperand(1)) in encodeInstruction()
215 .addImm(MI.getOperand(2).getImm() + 1); in encodeInstruction()
219 .addOperand(MI.getOperand(0)) in encodeInstruction()
220 .addOperand(MI.getOperand(1)) in encodeInstruction()
221 .addImm(32 - MI.getOperand(2).getImm()); in encodeInstruction()
224 auto V = 1 << MI.getOperand(1).getImm(); in encodeInstruction()
226 MCInstBuilder(CSKY::MOVI32).addOperand(MI.getOperand(0)).addImm(V); in encodeInstruction()
235 CSKYMCCodeEmitter::getMachineOpValue(const MCInst &MI, const MCOperand &MO, in getMachineOpValue() argument
249 CSKYMCCodeEmitter::getRegSeqImmOpValue(const MCInst &MI, unsigned Idx, in getRegSeqImmOpValue() argument
252 assert(MI.getOperand(Idx).isReg() && "Unexpected MO type."); in getRegSeqImmOpValue()
253 assert(MI.getOperand(Idx + 1).isImm() && "Unexpected MO type."); in getRegSeqImmOpValue()
255 unsigned Ry = MI.getOperand(Idx).getReg(); in getRegSeqImmOpValue()
256 unsigned Rz = MI.getOperand(Idx + 1).getImm(); in getRegSeqImmOpValue()
265 CSKYMCCodeEmitter::getRegisterSeqOpValue(const MCInst &MI, unsigned Op, in getRegisterSeqOpValue() argument
269 Ctx.getRegisterInfo()->getEncodingValue(MI.getOperand(Op).getReg()); in getRegisterSeqOpValue()
271 Ctx.getRegisterInfo()->getEncodingValue(MI.getOperand(Op + 1).getReg()); in getRegisterSeqOpValue()
278 unsigned CSKYMCCodeEmitter::getImmJMPIX(const MCInst &MI, unsigned Idx, in getImmJMPIX() argument
281 if (MI.getOperand(Idx).getImm() == 16) in getImmJMPIX()
283 else if (MI.getOperand(Idx).getImm() == 24) in getImmJMPIX()
285 else if (MI.getOperand(Idx).getImm() == 32) in getImmJMPIX()
287 else if (MI.getOperand(Idx).getImm() == 40) in getImmJMPIX()