1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
2 | |* *| |
3 | |* Pseudo-instruction MC lowering Source Fragment *| |
4 | |* *| |
5 | |* Automatically generated file, do not edit! *| |
6 | |* *| |
7 | \*===----------------------------------------------------------------------===*/ |
8 | |
9 | bool LoongArchAsmPrinter:: |
10 | emitPseudoExpansionLowering(MCStreamer &OutStreamer, |
11 | const MachineInstr *MI) { |
12 | switch (MI->getOpcode()) { |
13 | default: return false; |
14 | case LoongArch::PseudoAtomicStoreD: { |
15 | MCInst TmpInst; |
16 | MCOperand MCOp; |
17 | TmpInst.setOpcode(LoongArch::AMSWAP__DB_D); |
18 | // Operand: rd |
19 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
20 | // Operand: rk |
21 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
22 | TmpInst.addOperand(Op: MCOp); |
23 | // Operand: rj |
24 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
25 | TmpInst.addOperand(Op: MCOp); |
26 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
27 | break; |
28 | } |
29 | case LoongArch::PseudoAtomicStoreW: { |
30 | MCInst TmpInst; |
31 | MCOperand MCOp; |
32 | TmpInst.setOpcode(LoongArch::AMSWAP__DB_W); |
33 | // Operand: rd |
34 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
35 | // Operand: rk |
36 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
37 | TmpInst.addOperand(Op: MCOp); |
38 | // Operand: rj |
39 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
40 | TmpInst.addOperand(Op: MCOp); |
41 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
42 | break; |
43 | } |
44 | case LoongArch::PseudoBR: { |
45 | MCInst TmpInst; |
46 | MCOperand MCOp; |
47 | TmpInst.setOpcode(LoongArch::B); |
48 | // Operand: imm26 |
49 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
50 | TmpInst.addOperand(Op: MCOp); |
51 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
52 | break; |
53 | } |
54 | case LoongArch::PseudoBRIND: { |
55 | MCInst TmpInst; |
56 | MCOperand MCOp; |
57 | TmpInst.setOpcode(LoongArch::JIRL); |
58 | // Operand: rd |
59 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
60 | // Operand: rj |
61 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
62 | TmpInst.addOperand(Op: MCOp); |
63 | // Operand: imm16 |
64 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
65 | TmpInst.addOperand(Op: MCOp); |
66 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
67 | break; |
68 | } |
69 | case LoongArch::PseudoB_TAIL: { |
70 | MCInst TmpInst; |
71 | MCOperand MCOp; |
72 | TmpInst.setOpcode(LoongArch::B); |
73 | // Operand: imm26 |
74 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
75 | TmpInst.addOperand(Op: MCOp); |
76 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
77 | break; |
78 | } |
79 | case LoongArch::PseudoCALLIndirect: { |
80 | MCInst TmpInst; |
81 | MCOperand MCOp; |
82 | TmpInst.setOpcode(LoongArch::JIRL); |
83 | // Operand: rd |
84 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R1)); |
85 | // Operand: rj |
86 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
87 | TmpInst.addOperand(Op: MCOp); |
88 | // Operand: imm16 |
89 | TmpInst.addOperand(Op: MCOperand::createImm(Val: 0)); |
90 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
91 | break; |
92 | } |
93 | case LoongArch::PseudoDESC_CALL: { |
94 | MCInst TmpInst; |
95 | MCOperand MCOp; |
96 | TmpInst.setOpcode(LoongArch::JIRL); |
97 | // Operand: rd |
98 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
99 | TmpInst.addOperand(Op: MCOp); |
100 | // Operand: rj |
101 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
102 | TmpInst.addOperand(Op: MCOp); |
103 | // Operand: imm16 |
104 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
105 | TmpInst.addOperand(Op: MCOp); |
106 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
107 | break; |
108 | } |
109 | case LoongArch::PseudoJIRL_CALL: { |
110 | MCInst TmpInst; |
111 | MCOperand MCOp; |
112 | TmpInst.setOpcode(LoongArch::JIRL); |
113 | // Operand: rd |
114 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R1)); |
115 | // Operand: rj |
116 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
117 | TmpInst.addOperand(Op: MCOp); |
118 | // Operand: imm16 |
119 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
120 | TmpInst.addOperand(Op: MCOp); |
121 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
122 | break; |
123 | } |
124 | case LoongArch::PseudoJIRL_TAIL: { |
125 | MCInst TmpInst; |
126 | MCOperand MCOp; |
127 | TmpInst.setOpcode(LoongArch::JIRL); |
128 | // Operand: rd |
129 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
130 | // Operand: rj |
131 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
132 | TmpInst.addOperand(Op: MCOp); |
133 | // Operand: imm16 |
134 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
135 | TmpInst.addOperand(Op: MCOp); |
136 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
137 | break; |
138 | } |
139 | case LoongArch::PseudoRET: { |
140 | MCInst TmpInst; |
141 | MCOperand MCOp; |
142 | TmpInst.setOpcode(LoongArch::JIRL); |
143 | // Operand: rd |
144 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
145 | // Operand: rj |
146 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R1)); |
147 | // Operand: imm16 |
148 | TmpInst.addOperand(Op: MCOperand::createImm(Val: 0)); |
149 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
150 | break; |
151 | } |
152 | case LoongArch::PseudoTAILIndirect: { |
153 | MCInst TmpInst; |
154 | MCOperand MCOp; |
155 | TmpInst.setOpcode(LoongArch::JIRL); |
156 | // Operand: rd |
157 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
158 | // Operand: rj |
159 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
160 | TmpInst.addOperand(Op: MCOp); |
161 | // Operand: imm16 |
162 | TmpInst.addOperand(Op: MCOperand::createImm(Val: 0)); |
163 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
164 | break; |
165 | } |
166 | case LoongArch::PseudoUNIMP: { |
167 | MCInst TmpInst; |
168 | MCOperand MCOp; |
169 | TmpInst.setOpcode(LoongArch::AMSWAP_W); |
170 | // Operand: rd |
171 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
172 | // Operand: rk |
173 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R1)); |
174 | // Operand: rj |
175 | TmpInst.addOperand(Op: MCOperand::createReg(Reg: LoongArch::R0)); |
176 | EmitToStreamer(S&: OutStreamer, Inst: TmpInst); |
177 | break; |
178 | } |
179 | } |
180 | return true; |
181 | } |
182 | |
183 | |