1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Pseudo-instruction MC lowering Source Fragment *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9bool MipsAsmPrinter::
10lowerPseudoInstExpansion(const MachineInstr *MI, MCInst &Inst) {
11 Inst.clear();
12 switch (MI->getOpcode()) {
13 default: return false;
14 case Mips::AND_V_D_PSEUDO: {
15 MCOperand MCOp;
16 Inst.setOpcode(Mips::AND_V);
17 // Operand: wd
18 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
19 Inst.addOperand(Op: MCOp);
20 // Operand: ws
21 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
22 Inst.addOperand(Op: MCOp);
23 // Operand: wt
24 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
25 Inst.addOperand(Op: MCOp);
26 break;
27 }
28 case Mips::AND_V_H_PSEUDO: {
29 MCOperand MCOp;
30 Inst.setOpcode(Mips::AND_V);
31 // Operand: wd
32 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
33 Inst.addOperand(Op: MCOp);
34 // Operand: ws
35 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
36 Inst.addOperand(Op: MCOp);
37 // Operand: wt
38 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
39 Inst.addOperand(Op: MCOp);
40 break;
41 }
42 case Mips::AND_V_W_PSEUDO: {
43 MCOperand MCOp;
44 Inst.setOpcode(Mips::AND_V);
45 // Operand: wd
46 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
47 Inst.addOperand(Op: MCOp);
48 // Operand: ws
49 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
50 Inst.addOperand(Op: MCOp);
51 // Operand: wt
52 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
53 Inst.addOperand(Op: MCOp);
54 break;
55 }
56 case Mips::B: {
57 MCOperand MCOp;
58 Inst.setOpcode(Mips::BEQ);
59 // Operand: rs
60 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
61 // Operand: rt
62 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
63 // Operand: offset
64 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
65 Inst.addOperand(Op: MCOp);
66 break;
67 }
68 case Mips::BAL_BR: {
69 MCOperand MCOp;
70 Inst.setOpcode(Mips::BGEZAL);
71 // Operand: rs
72 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
73 // Operand: offset
74 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
75 Inst.addOperand(Op: MCOp);
76 break;
77 }
78 case Mips::BAL_BR_MM: {
79 MCOperand MCOp;
80 Inst.setOpcode(Mips::BGEZAL_MM);
81 // Operand: rs
82 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
83 // Operand: offset
84 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
85 Inst.addOperand(Op: MCOp);
86 break;
87 }
88 case Mips::BSEL_D_PSEUDO: {
89 MCOperand MCOp;
90 Inst.setOpcode(Mips::BSEL_V);
91 // Operand: wd
92 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
93 Inst.addOperand(Op: MCOp);
94 // Operand: wd_in
95 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
96 Inst.addOperand(Op: MCOp);
97 // Operand: ws
98 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
99 Inst.addOperand(Op: MCOp);
100 // Operand: wt
101 lowerOperand(MO: MI->getOperand(i: 3), MCOp);
102 Inst.addOperand(Op: MCOp);
103 break;
104 }
105 case Mips::BSEL_FD_PSEUDO: {
106 MCOperand MCOp;
107 Inst.setOpcode(Mips::BSEL_V);
108 // Operand: wd
109 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
110 Inst.addOperand(Op: MCOp);
111 // Operand: wd_in
112 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
113 Inst.addOperand(Op: MCOp);
114 // Operand: ws
115 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
116 Inst.addOperand(Op: MCOp);
117 // Operand: wt
118 lowerOperand(MO: MI->getOperand(i: 3), MCOp);
119 Inst.addOperand(Op: MCOp);
120 break;
121 }
122 case Mips::BSEL_FW_PSEUDO: {
123 MCOperand MCOp;
124 Inst.setOpcode(Mips::BSEL_V);
125 // Operand: wd
126 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
127 Inst.addOperand(Op: MCOp);
128 // Operand: wd_in
129 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
130 Inst.addOperand(Op: MCOp);
131 // Operand: ws
132 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
133 Inst.addOperand(Op: MCOp);
134 // Operand: wt
135 lowerOperand(MO: MI->getOperand(i: 3), MCOp);
136 Inst.addOperand(Op: MCOp);
137 break;
138 }
139 case Mips::BSEL_H_PSEUDO: {
140 MCOperand MCOp;
141 Inst.setOpcode(Mips::BSEL_V);
142 // Operand: wd
143 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
144 Inst.addOperand(Op: MCOp);
145 // Operand: wd_in
146 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
147 Inst.addOperand(Op: MCOp);
148 // Operand: ws
149 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
150 Inst.addOperand(Op: MCOp);
151 // Operand: wt
152 lowerOperand(MO: MI->getOperand(i: 3), MCOp);
153 Inst.addOperand(Op: MCOp);
154 break;
155 }
156 case Mips::BSEL_W_PSEUDO: {
157 MCOperand MCOp;
158 Inst.setOpcode(Mips::BSEL_V);
159 // Operand: wd
160 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
161 Inst.addOperand(Op: MCOp);
162 // Operand: wd_in
163 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
164 Inst.addOperand(Op: MCOp);
165 // Operand: ws
166 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
167 Inst.addOperand(Op: MCOp);
168 // Operand: wt
169 lowerOperand(MO: MI->getOperand(i: 3), MCOp);
170 Inst.addOperand(Op: MCOp);
171 break;
172 }
173 case Mips::B_MM: {
174 MCOperand MCOp;
175 Inst.setOpcode(Mips::BEQ_MM);
176 // Operand: rs
177 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
178 // Operand: rt
179 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
180 // Operand: offset
181 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
182 Inst.addOperand(Op: MCOp);
183 break;
184 }
185 case Mips::FABS_D: {
186 MCOperand MCOp;
187 Inst.setOpcode(Mips::FMAX_A_D);
188 // Operand: wd
189 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
190 Inst.addOperand(Op: MCOp);
191 // Operand: ws
192 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
193 Inst.addOperand(Op: MCOp);
194 // Operand: wt
195 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
196 Inst.addOperand(Op: MCOp);
197 break;
198 }
199 case Mips::FABS_W: {
200 MCOperand MCOp;
201 Inst.setOpcode(Mips::FMAX_A_W);
202 // Operand: wd
203 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
204 Inst.addOperand(Op: MCOp);
205 // Operand: ws
206 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
207 Inst.addOperand(Op: MCOp);
208 // Operand: wt
209 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
210 Inst.addOperand(Op: MCOp);
211 break;
212 }
213 case Mips::JALR64Pseudo: {
214 MCOperand MCOp;
215 Inst.setOpcode(Mips::JALR);
216 // Operand: rd
217 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA));
218 // Operand: rs
219 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
220 Inst.addOperand(Op: MCOp);
221 break;
222 }
223 case Mips::JALRHB64Pseudo: {
224 MCOperand MCOp;
225 Inst.setOpcode(Mips::JALR_HB64);
226 // Operand: rd
227 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA_64));
228 // Operand: rs
229 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
230 Inst.addOperand(Op: MCOp);
231 break;
232 }
233 case Mips::JALRHBPseudo: {
234 MCOperand MCOp;
235 Inst.setOpcode(Mips::JALR_HB);
236 // Operand: rd
237 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA));
238 // Operand: rs
239 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
240 Inst.addOperand(Op: MCOp);
241 break;
242 }
243 case Mips::JALRPseudo: {
244 MCOperand MCOp;
245 Inst.setOpcode(Mips::JALR);
246 // Operand: rd
247 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA));
248 // Operand: rs
249 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
250 Inst.addOperand(Op: MCOp);
251 break;
252 }
253 case Mips::JAL_MMR6: {
254 MCOperand MCOp;
255 Inst.setOpcode(Mips::BALC_MMR6);
256 // Operand: offset
257 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
258 Inst.addOperand(Op: MCOp);
259 break;
260 }
261 case Mips::NOP: {
262 MCOperand MCOp;
263 Inst.setOpcode(Mips::SLL);
264 // Operand: rd
265 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
266 // Operand: rt
267 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
268 // Operand: shamt
269 Inst.addOperand(Op: MCOperand::createImm(Val: 0));
270 break;
271 }
272 case Mips::NOR_V_D_PSEUDO: {
273 MCOperand MCOp;
274 Inst.setOpcode(Mips::NOR_V);
275 // Operand: wd
276 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
277 Inst.addOperand(Op: MCOp);
278 // Operand: ws
279 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
280 Inst.addOperand(Op: MCOp);
281 // Operand: wt
282 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
283 Inst.addOperand(Op: MCOp);
284 break;
285 }
286 case Mips::NOR_V_H_PSEUDO: {
287 MCOperand MCOp;
288 Inst.setOpcode(Mips::NOR_V);
289 // Operand: wd
290 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
291 Inst.addOperand(Op: MCOp);
292 // Operand: ws
293 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
294 Inst.addOperand(Op: MCOp);
295 // Operand: wt
296 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
297 Inst.addOperand(Op: MCOp);
298 break;
299 }
300 case Mips::NOR_V_W_PSEUDO: {
301 MCOperand MCOp;
302 Inst.setOpcode(Mips::NOR_V);
303 // Operand: wd
304 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
305 Inst.addOperand(Op: MCOp);
306 // Operand: ws
307 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
308 Inst.addOperand(Op: MCOp);
309 // Operand: wt
310 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
311 Inst.addOperand(Op: MCOp);
312 break;
313 }
314 case Mips::OR_V_D_PSEUDO: {
315 MCOperand MCOp;
316 Inst.setOpcode(Mips::OR_V);
317 // Operand: wd
318 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
319 Inst.addOperand(Op: MCOp);
320 // Operand: ws
321 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
322 Inst.addOperand(Op: MCOp);
323 // Operand: wt
324 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
325 Inst.addOperand(Op: MCOp);
326 break;
327 }
328 case Mips::OR_V_H_PSEUDO: {
329 MCOperand MCOp;
330 Inst.setOpcode(Mips::OR_V);
331 // Operand: wd
332 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
333 Inst.addOperand(Op: MCOp);
334 // Operand: ws
335 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
336 Inst.addOperand(Op: MCOp);
337 // Operand: wt
338 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
339 Inst.addOperand(Op: MCOp);
340 break;
341 }
342 case Mips::OR_V_W_PSEUDO: {
343 MCOperand MCOp;
344 Inst.setOpcode(Mips::OR_V);
345 // Operand: wd
346 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
347 Inst.addOperand(Op: MCOp);
348 // Operand: ws
349 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
350 Inst.addOperand(Op: MCOp);
351 // Operand: wt
352 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
353 Inst.addOperand(Op: MCOp);
354 break;
355 }
356 case Mips::PseudoCMPU_EQ_QB: {
357 MCOperand MCOp;
358 Inst.setOpcode(Mips::CMPU_EQ_QB);
359 // Operand: rs
360 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
361 Inst.addOperand(Op: MCOp);
362 // Operand: rt
363 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
364 Inst.addOperand(Op: MCOp);
365 break;
366 }
367 case Mips::PseudoCMPU_LE_QB: {
368 MCOperand MCOp;
369 Inst.setOpcode(Mips::CMPU_LE_QB);
370 // Operand: rs
371 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
372 Inst.addOperand(Op: MCOp);
373 // Operand: rt
374 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
375 Inst.addOperand(Op: MCOp);
376 break;
377 }
378 case Mips::PseudoCMPU_LT_QB: {
379 MCOperand MCOp;
380 Inst.setOpcode(Mips::CMPU_LT_QB);
381 // Operand: rs
382 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
383 Inst.addOperand(Op: MCOp);
384 // Operand: rt
385 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
386 Inst.addOperand(Op: MCOp);
387 break;
388 }
389 case Mips::PseudoCMP_EQ_PH: {
390 MCOperand MCOp;
391 Inst.setOpcode(Mips::CMP_EQ_PH);
392 // Operand: rs
393 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
394 Inst.addOperand(Op: MCOp);
395 // Operand: rt
396 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
397 Inst.addOperand(Op: MCOp);
398 break;
399 }
400 case Mips::PseudoCMP_LE_PH: {
401 MCOperand MCOp;
402 Inst.setOpcode(Mips::CMP_LE_PH);
403 // Operand: rs
404 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
405 Inst.addOperand(Op: MCOp);
406 // Operand: rt
407 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
408 Inst.addOperand(Op: MCOp);
409 break;
410 }
411 case Mips::PseudoCMP_LT_PH: {
412 MCOperand MCOp;
413 Inst.setOpcode(Mips::CMP_LT_PH);
414 // Operand: rs
415 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
416 Inst.addOperand(Op: MCOp);
417 // Operand: rt
418 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
419 Inst.addOperand(Op: MCOp);
420 break;
421 }
422 case Mips::PseudoDMULT: {
423 MCOperand MCOp;
424 Inst.setOpcode(Mips::DMULT);
425 // Operand: rs
426 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
427 Inst.addOperand(Op: MCOp);
428 // Operand: rt
429 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
430 Inst.addOperand(Op: MCOp);
431 break;
432 }
433 case Mips::PseudoDMULTu: {
434 MCOperand MCOp;
435 Inst.setOpcode(Mips::DMULTu);
436 // Operand: rs
437 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
438 Inst.addOperand(Op: MCOp);
439 // Operand: rt
440 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
441 Inst.addOperand(Op: MCOp);
442 break;
443 }
444 case Mips::PseudoDSDIV: {
445 MCOperand MCOp;
446 Inst.setOpcode(Mips::DSDIV);
447 // Operand: rs
448 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
449 Inst.addOperand(Op: MCOp);
450 // Operand: rt
451 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
452 Inst.addOperand(Op: MCOp);
453 break;
454 }
455 case Mips::PseudoDUDIV: {
456 MCOperand MCOp;
457 Inst.setOpcode(Mips::DUDIV);
458 // Operand: rs
459 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
460 Inst.addOperand(Op: MCOp);
461 // Operand: rt
462 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
463 Inst.addOperand(Op: MCOp);
464 break;
465 }
466 case Mips::PseudoIndirectBranch: {
467 MCOperand MCOp;
468 Inst.setOpcode(Mips::JR);
469 // Operand: rs
470 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
471 Inst.addOperand(Op: MCOp);
472 break;
473 }
474 case Mips::PseudoIndirectBranch64: {
475 MCOperand MCOp;
476 Inst.setOpcode(Mips::JR64);
477 // Operand: rs
478 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
479 Inst.addOperand(Op: MCOp);
480 break;
481 }
482 case Mips::PseudoIndirectBranch64R6: {
483 MCOperand MCOp;
484 Inst.setOpcode(Mips::JALR64);
485 // Operand: rd
486 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO_64));
487 // Operand: rs
488 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
489 Inst.addOperand(Op: MCOp);
490 break;
491 }
492 case Mips::PseudoIndirectBranchR6: {
493 MCOperand MCOp;
494 Inst.setOpcode(Mips::JALR);
495 // Operand: rd
496 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
497 // Operand: rs
498 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
499 Inst.addOperand(Op: MCOp);
500 break;
501 }
502 case Mips::PseudoIndirectBranch_MM: {
503 MCOperand MCOp;
504 Inst.setOpcode(Mips::JR_MM);
505 // Operand: rs
506 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
507 Inst.addOperand(Op: MCOp);
508 break;
509 }
510 case Mips::PseudoIndirectBranch_MMR6: {
511 MCOperand MCOp;
512 Inst.setOpcode(Mips::JRC16_MMR6);
513 // Operand: rs
514 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
515 Inst.addOperand(Op: MCOp);
516 break;
517 }
518 case Mips::PseudoIndirectHazardBranch: {
519 MCOperand MCOp;
520 Inst.setOpcode(Mips::JR_HB);
521 // Operand: rs
522 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
523 Inst.addOperand(Op: MCOp);
524 break;
525 }
526 case Mips::PseudoIndirectHazardBranch64: {
527 MCOperand MCOp;
528 Inst.setOpcode(Mips::JR_HB64);
529 // Operand: rs
530 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
531 Inst.addOperand(Op: MCOp);
532 break;
533 }
534 case Mips::PseudoIndrectHazardBranch64R6: {
535 MCOperand MCOp;
536 Inst.setOpcode(Mips::JR_HB64_R6);
537 // Operand: rs
538 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
539 Inst.addOperand(Op: MCOp);
540 break;
541 }
542 case Mips::PseudoIndrectHazardBranchR6: {
543 MCOperand MCOp;
544 Inst.setOpcode(Mips::JR_HB_R6);
545 // Operand: rs
546 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
547 Inst.addOperand(Op: MCOp);
548 break;
549 }
550 case Mips::PseudoMADD: {
551 MCOperand MCOp;
552 Inst.setOpcode(Mips::MADD);
553 // Operand: rs
554 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
555 Inst.addOperand(Op: MCOp);
556 // Operand: rt
557 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
558 Inst.addOperand(Op: MCOp);
559 break;
560 }
561 case Mips::PseudoMADDU: {
562 MCOperand MCOp;
563 Inst.setOpcode(Mips::MADDU);
564 // Operand: rs
565 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
566 Inst.addOperand(Op: MCOp);
567 // Operand: rt
568 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
569 Inst.addOperand(Op: MCOp);
570 break;
571 }
572 case Mips::PseudoMADDU_MM: {
573 MCOperand MCOp;
574 Inst.setOpcode(Mips::MADDU);
575 // Operand: rs
576 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
577 Inst.addOperand(Op: MCOp);
578 // Operand: rt
579 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
580 Inst.addOperand(Op: MCOp);
581 break;
582 }
583 case Mips::PseudoMADD_MM: {
584 MCOperand MCOp;
585 Inst.setOpcode(Mips::MADD);
586 // Operand: rs
587 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
588 Inst.addOperand(Op: MCOp);
589 // Operand: rt
590 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
591 Inst.addOperand(Op: MCOp);
592 break;
593 }
594 case Mips::PseudoMSUB: {
595 MCOperand MCOp;
596 Inst.setOpcode(Mips::MSUB);
597 // Operand: rs
598 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
599 Inst.addOperand(Op: MCOp);
600 // Operand: rt
601 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
602 Inst.addOperand(Op: MCOp);
603 break;
604 }
605 case Mips::PseudoMSUBU: {
606 MCOperand MCOp;
607 Inst.setOpcode(Mips::MSUBU);
608 // Operand: rs
609 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
610 Inst.addOperand(Op: MCOp);
611 // Operand: rt
612 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
613 Inst.addOperand(Op: MCOp);
614 break;
615 }
616 case Mips::PseudoMSUBU_MM: {
617 MCOperand MCOp;
618 Inst.setOpcode(Mips::MSUBU);
619 // Operand: rs
620 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
621 Inst.addOperand(Op: MCOp);
622 // Operand: rt
623 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
624 Inst.addOperand(Op: MCOp);
625 break;
626 }
627 case Mips::PseudoMSUB_MM: {
628 MCOperand MCOp;
629 Inst.setOpcode(Mips::MSUB);
630 // Operand: rs
631 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
632 Inst.addOperand(Op: MCOp);
633 // Operand: rt
634 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
635 Inst.addOperand(Op: MCOp);
636 break;
637 }
638 case Mips::PseudoMULT: {
639 MCOperand MCOp;
640 Inst.setOpcode(Mips::MULT);
641 // Operand: rs
642 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
643 Inst.addOperand(Op: MCOp);
644 // Operand: rt
645 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
646 Inst.addOperand(Op: MCOp);
647 break;
648 }
649 case Mips::PseudoMULT_MM: {
650 MCOperand MCOp;
651 Inst.setOpcode(Mips::MULT);
652 // Operand: rs
653 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
654 Inst.addOperand(Op: MCOp);
655 // Operand: rt
656 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
657 Inst.addOperand(Op: MCOp);
658 break;
659 }
660 case Mips::PseudoMULTu: {
661 MCOperand MCOp;
662 Inst.setOpcode(Mips::MULTu);
663 // Operand: rs
664 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
665 Inst.addOperand(Op: MCOp);
666 // Operand: rt
667 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
668 Inst.addOperand(Op: MCOp);
669 break;
670 }
671 case Mips::PseudoMULTu_MM: {
672 MCOperand MCOp;
673 Inst.setOpcode(Mips::MULTu);
674 // Operand: rs
675 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
676 Inst.addOperand(Op: MCOp);
677 // Operand: rt
678 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
679 Inst.addOperand(Op: MCOp);
680 break;
681 }
682 case Mips::PseudoPICK_PH: {
683 MCOperand MCOp;
684 Inst.setOpcode(Mips::PICK_PH);
685 // Operand: rd
686 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
687 Inst.addOperand(Op: MCOp);
688 // Operand: rs
689 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
690 Inst.addOperand(Op: MCOp);
691 // Operand: rt
692 lowerOperand(MO: MI->getOperand(i: 3), MCOp);
693 Inst.addOperand(Op: MCOp);
694 break;
695 }
696 case Mips::PseudoPICK_QB: {
697 MCOperand MCOp;
698 Inst.setOpcode(Mips::PICK_QB);
699 // Operand: rd
700 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
701 Inst.addOperand(Op: MCOp);
702 // Operand: rs
703 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
704 Inst.addOperand(Op: MCOp);
705 // Operand: rt
706 lowerOperand(MO: MI->getOperand(i: 3), MCOp);
707 Inst.addOperand(Op: MCOp);
708 break;
709 }
710 case Mips::PseudoSDIV: {
711 MCOperand MCOp;
712 Inst.setOpcode(Mips::SDIV);
713 // Operand: rs
714 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
715 Inst.addOperand(Op: MCOp);
716 // Operand: rt
717 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
718 Inst.addOperand(Op: MCOp);
719 break;
720 }
721 case Mips::PseudoUDIV: {
722 MCOperand MCOp;
723 Inst.setOpcode(Mips::UDIV);
724 // Operand: rs
725 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
726 Inst.addOperand(Op: MCOp);
727 // Operand: rt
728 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
729 Inst.addOperand(Op: MCOp);
730 break;
731 }
732 case Mips::SDIV_MM_Pseudo: {
733 MCOperand MCOp;
734 Inst.setOpcode(Mips::SDIV_MM);
735 // Operand: rs
736 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
737 Inst.addOperand(Op: MCOp);
738 // Operand: rt
739 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
740 Inst.addOperand(Op: MCOp);
741 break;
742 }
743 case Mips::TAILCALL: {
744 MCOperand MCOp;
745 Inst.setOpcode(Mips::J);
746 // Operand: target
747 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
748 Inst.addOperand(Op: MCOp);
749 break;
750 }
751 case Mips::TAILCALL64R6REG: {
752 MCOperand MCOp;
753 Inst.setOpcode(Mips::JALR64);
754 // Operand: rd
755 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO_64));
756 // Operand: rs
757 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
758 Inst.addOperand(Op: MCOp);
759 break;
760 }
761 case Mips::TAILCALLHB64R6REG: {
762 MCOperand MCOp;
763 Inst.setOpcode(Mips::JR_HB64_R6);
764 // Operand: rs
765 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
766 Inst.addOperand(Op: MCOp);
767 break;
768 }
769 case Mips::TAILCALLHBR6REG: {
770 MCOperand MCOp;
771 Inst.setOpcode(Mips::JR_HB_R6);
772 // Operand: rs
773 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
774 Inst.addOperand(Op: MCOp);
775 break;
776 }
777 case Mips::TAILCALLR6REG: {
778 MCOperand MCOp;
779 Inst.setOpcode(Mips::JALR);
780 // Operand: rd
781 Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO));
782 // Operand: rs
783 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
784 Inst.addOperand(Op: MCOp);
785 break;
786 }
787 case Mips::TAILCALLREG: {
788 MCOperand MCOp;
789 Inst.setOpcode(Mips::JR);
790 // Operand: rs
791 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
792 Inst.addOperand(Op: MCOp);
793 break;
794 }
795 case Mips::TAILCALLREG64: {
796 MCOperand MCOp;
797 Inst.setOpcode(Mips::JR64);
798 // Operand: rs
799 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
800 Inst.addOperand(Op: MCOp);
801 break;
802 }
803 case Mips::TAILCALLREGHB: {
804 MCOperand MCOp;
805 Inst.setOpcode(Mips::JR_HB);
806 // Operand: rs
807 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
808 Inst.addOperand(Op: MCOp);
809 break;
810 }
811 case Mips::TAILCALLREGHB64: {
812 MCOperand MCOp;
813 Inst.setOpcode(Mips::JR_HB64);
814 // Operand: rs
815 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
816 Inst.addOperand(Op: MCOp);
817 break;
818 }
819 case Mips::TAILCALLREG_MM: {
820 MCOperand MCOp;
821 Inst.setOpcode(Mips::JRC16_MM);
822 // Operand: rs
823 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
824 Inst.addOperand(Op: MCOp);
825 break;
826 }
827 case Mips::TAILCALLREG_MMR6: {
828 MCOperand MCOp;
829 Inst.setOpcode(Mips::JRC16_MM);
830 // Operand: rs
831 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
832 Inst.addOperand(Op: MCOp);
833 break;
834 }
835 case Mips::TAILCALL_MM: {
836 MCOperand MCOp;
837 Inst.setOpcode(Mips::J_MM);
838 // Operand: target
839 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
840 Inst.addOperand(Op: MCOp);
841 break;
842 }
843 case Mips::TAILCALL_MMR6: {
844 MCOperand MCOp;
845 Inst.setOpcode(Mips::BC_MMR6);
846 // Operand: offset
847 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
848 Inst.addOperand(Op: MCOp);
849 break;
850 }
851 case Mips::TRAP: {
852 MCOperand MCOp;
853 Inst.setOpcode(Mips::BREAK);
854 // Operand: code_1
855 Inst.addOperand(Op: MCOperand::createImm(Val: 0));
856 // Operand: code_2
857 Inst.addOperand(Op: MCOperand::createImm(Val: 0));
858 break;
859 }
860 case Mips::TRAP_MM: {
861 MCOperand MCOp;
862 Inst.setOpcode(Mips::BREAK_MM);
863 // Operand: code_1
864 Inst.addOperand(Op: MCOperand::createImm(Val: 0));
865 // Operand: code_2
866 Inst.addOperand(Op: MCOperand::createImm(Val: 0));
867 break;
868 }
869 case Mips::UDIV_MM_Pseudo: {
870 MCOperand MCOp;
871 Inst.setOpcode(Mips::UDIV_MM);
872 // Operand: rs
873 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
874 Inst.addOperand(Op: MCOp);
875 // Operand: rt
876 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
877 Inst.addOperand(Op: MCOp);
878 break;
879 }
880 case Mips::XOR_V_D_PSEUDO: {
881 MCOperand MCOp;
882 Inst.setOpcode(Mips::XOR_V);
883 // Operand: wd
884 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
885 Inst.addOperand(Op: MCOp);
886 // Operand: ws
887 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
888 Inst.addOperand(Op: MCOp);
889 // Operand: wt
890 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
891 Inst.addOperand(Op: MCOp);
892 break;
893 }
894 case Mips::XOR_V_H_PSEUDO: {
895 MCOperand MCOp;
896 Inst.setOpcode(Mips::XOR_V);
897 // Operand: wd
898 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
899 Inst.addOperand(Op: MCOp);
900 // Operand: ws
901 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
902 Inst.addOperand(Op: MCOp);
903 // Operand: wt
904 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
905 Inst.addOperand(Op: MCOp);
906 break;
907 }
908 case Mips::XOR_V_W_PSEUDO: {
909 MCOperand MCOp;
910 Inst.setOpcode(Mips::XOR_V);
911 // Operand: wd
912 lowerOperand(MO: MI->getOperand(i: 0), MCOp);
913 Inst.addOperand(Op: MCOp);
914 // Operand: ws
915 lowerOperand(MO: MI->getOperand(i: 1), MCOp);
916 Inst.addOperand(Op: MCOp);
917 // Operand: wt
918 lowerOperand(MO: MI->getOperand(i: 2), MCOp);
919 Inst.addOperand(Op: MCOp);
920 break;
921 }
922 }
923 return true;
924}
925
926