| 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 MipsAsmPrinter:: |
| 10 | lowerPseudoInstExpansion(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::BCLRI_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: m |
| 195 | Inst.addOperand(Op: MCOperand::createImm(Val: 63)); |
| 196 | break; |
| 197 | } |
| 198 | case Mips::FABS_W: { |
| 199 | MCOperand MCOp; |
| 200 | Inst.setOpcode(Mips::BCLRI_W); |
| 201 | // Operand: wd |
| 202 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 203 | Inst.addOperand(Op: MCOp); |
| 204 | // Operand: ws |
| 205 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 206 | Inst.addOperand(Op: MCOp); |
| 207 | // Operand: m |
| 208 | Inst.addOperand(Op: MCOperand::createImm(Val: 31)); |
| 209 | break; |
| 210 | } |
| 211 | case Mips::JALR64Pseudo: { |
| 212 | MCOperand MCOp; |
| 213 | Inst.setOpcode(Mips::JALR); |
| 214 | // Operand: rd |
| 215 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA)); |
| 216 | // Operand: rs |
| 217 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 218 | Inst.addOperand(Op: MCOp); |
| 219 | break; |
| 220 | } |
| 221 | case Mips::JALRHB64Pseudo: { |
| 222 | MCOperand MCOp; |
| 223 | Inst.setOpcode(Mips::JALR_HB64); |
| 224 | // Operand: rd |
| 225 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA_64)); |
| 226 | // Operand: rs |
| 227 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 228 | Inst.addOperand(Op: MCOp); |
| 229 | break; |
| 230 | } |
| 231 | case Mips::JALRHBPseudo: { |
| 232 | MCOperand MCOp; |
| 233 | Inst.setOpcode(Mips::JALR_HB); |
| 234 | // Operand: rd |
| 235 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA)); |
| 236 | // Operand: rs |
| 237 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 238 | Inst.addOperand(Op: MCOp); |
| 239 | break; |
| 240 | } |
| 241 | case Mips::JALRPseudo: { |
| 242 | MCOperand MCOp; |
| 243 | Inst.setOpcode(Mips::JALR); |
| 244 | // Operand: rd |
| 245 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::RA)); |
| 246 | // Operand: rs |
| 247 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 248 | Inst.addOperand(Op: MCOp); |
| 249 | break; |
| 250 | } |
| 251 | case Mips::JAL_MMR6: { |
| 252 | MCOperand MCOp; |
| 253 | Inst.setOpcode(Mips::BALC_MMR6); |
| 254 | // Operand: offset |
| 255 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 256 | Inst.addOperand(Op: MCOp); |
| 257 | break; |
| 258 | } |
| 259 | case Mips::NOP: { |
| 260 | MCOperand MCOp; |
| 261 | Inst.setOpcode(Mips::SLL); |
| 262 | // Operand: rd |
| 263 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO)); |
| 264 | // Operand: rt |
| 265 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO)); |
| 266 | // Operand: shamt |
| 267 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 268 | break; |
| 269 | } |
| 270 | case Mips::NOR_V_D_PSEUDO: { |
| 271 | MCOperand MCOp; |
| 272 | Inst.setOpcode(Mips::NOR_V); |
| 273 | // Operand: wd |
| 274 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 275 | Inst.addOperand(Op: MCOp); |
| 276 | // Operand: ws |
| 277 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 278 | Inst.addOperand(Op: MCOp); |
| 279 | // Operand: wt |
| 280 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 281 | Inst.addOperand(Op: MCOp); |
| 282 | break; |
| 283 | } |
| 284 | case Mips::NOR_V_H_PSEUDO: { |
| 285 | MCOperand MCOp; |
| 286 | Inst.setOpcode(Mips::NOR_V); |
| 287 | // Operand: wd |
| 288 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 289 | Inst.addOperand(Op: MCOp); |
| 290 | // Operand: ws |
| 291 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 292 | Inst.addOperand(Op: MCOp); |
| 293 | // Operand: wt |
| 294 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 295 | Inst.addOperand(Op: MCOp); |
| 296 | break; |
| 297 | } |
| 298 | case Mips::NOR_V_W_PSEUDO: { |
| 299 | MCOperand MCOp; |
| 300 | Inst.setOpcode(Mips::NOR_V); |
| 301 | // Operand: wd |
| 302 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 303 | Inst.addOperand(Op: MCOp); |
| 304 | // Operand: ws |
| 305 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 306 | Inst.addOperand(Op: MCOp); |
| 307 | // Operand: wt |
| 308 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 309 | Inst.addOperand(Op: MCOp); |
| 310 | break; |
| 311 | } |
| 312 | case Mips::OR_V_D_PSEUDO: { |
| 313 | MCOperand MCOp; |
| 314 | Inst.setOpcode(Mips::OR_V); |
| 315 | // Operand: wd |
| 316 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 317 | Inst.addOperand(Op: MCOp); |
| 318 | // Operand: ws |
| 319 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 320 | Inst.addOperand(Op: MCOp); |
| 321 | // Operand: wt |
| 322 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 323 | Inst.addOperand(Op: MCOp); |
| 324 | break; |
| 325 | } |
| 326 | case Mips::OR_V_H_PSEUDO: { |
| 327 | MCOperand MCOp; |
| 328 | Inst.setOpcode(Mips::OR_V); |
| 329 | // Operand: wd |
| 330 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 331 | Inst.addOperand(Op: MCOp); |
| 332 | // Operand: ws |
| 333 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 334 | Inst.addOperand(Op: MCOp); |
| 335 | // Operand: wt |
| 336 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 337 | Inst.addOperand(Op: MCOp); |
| 338 | break; |
| 339 | } |
| 340 | case Mips::OR_V_W_PSEUDO: { |
| 341 | MCOperand MCOp; |
| 342 | Inst.setOpcode(Mips::OR_V); |
| 343 | // Operand: wd |
| 344 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 345 | Inst.addOperand(Op: MCOp); |
| 346 | // Operand: ws |
| 347 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 348 | Inst.addOperand(Op: MCOp); |
| 349 | // Operand: wt |
| 350 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 351 | Inst.addOperand(Op: MCOp); |
| 352 | break; |
| 353 | } |
| 354 | case Mips::PseudoCMPU_EQ_QB: { |
| 355 | MCOperand MCOp; |
| 356 | Inst.setOpcode(Mips::CMPU_EQ_QB); |
| 357 | // Operand: rs |
| 358 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 359 | Inst.addOperand(Op: MCOp); |
| 360 | // Operand: rt |
| 361 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 362 | Inst.addOperand(Op: MCOp); |
| 363 | break; |
| 364 | } |
| 365 | case Mips::PseudoCMPU_LE_QB: { |
| 366 | MCOperand MCOp; |
| 367 | Inst.setOpcode(Mips::CMPU_LE_QB); |
| 368 | // Operand: rs |
| 369 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 370 | Inst.addOperand(Op: MCOp); |
| 371 | // Operand: rt |
| 372 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 373 | Inst.addOperand(Op: MCOp); |
| 374 | break; |
| 375 | } |
| 376 | case Mips::PseudoCMPU_LT_QB: { |
| 377 | MCOperand MCOp; |
| 378 | Inst.setOpcode(Mips::CMPU_LT_QB); |
| 379 | // Operand: rs |
| 380 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 381 | Inst.addOperand(Op: MCOp); |
| 382 | // Operand: rt |
| 383 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 384 | Inst.addOperand(Op: MCOp); |
| 385 | break; |
| 386 | } |
| 387 | case Mips::PseudoCMP_EQ_PH: { |
| 388 | MCOperand MCOp; |
| 389 | Inst.setOpcode(Mips::CMP_EQ_PH); |
| 390 | // Operand: rs |
| 391 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 392 | Inst.addOperand(Op: MCOp); |
| 393 | // Operand: rt |
| 394 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 395 | Inst.addOperand(Op: MCOp); |
| 396 | break; |
| 397 | } |
| 398 | case Mips::PseudoCMP_LE_PH: { |
| 399 | MCOperand MCOp; |
| 400 | Inst.setOpcode(Mips::CMP_LE_PH); |
| 401 | // Operand: rs |
| 402 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 403 | Inst.addOperand(Op: MCOp); |
| 404 | // Operand: rt |
| 405 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 406 | Inst.addOperand(Op: MCOp); |
| 407 | break; |
| 408 | } |
| 409 | case Mips::PseudoCMP_LT_PH: { |
| 410 | MCOperand MCOp; |
| 411 | Inst.setOpcode(Mips::CMP_LT_PH); |
| 412 | // Operand: rs |
| 413 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 414 | Inst.addOperand(Op: MCOp); |
| 415 | // Operand: rt |
| 416 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 417 | Inst.addOperand(Op: MCOp); |
| 418 | break; |
| 419 | } |
| 420 | case Mips::PseudoDMULT: { |
| 421 | MCOperand MCOp; |
| 422 | Inst.setOpcode(Mips::DMULT); |
| 423 | // Operand: rs |
| 424 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 425 | Inst.addOperand(Op: MCOp); |
| 426 | // Operand: rt |
| 427 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 428 | Inst.addOperand(Op: MCOp); |
| 429 | break; |
| 430 | } |
| 431 | case Mips::PseudoDMULTu: { |
| 432 | MCOperand MCOp; |
| 433 | Inst.setOpcode(Mips::DMULTu); |
| 434 | // Operand: rs |
| 435 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 436 | Inst.addOperand(Op: MCOp); |
| 437 | // Operand: rt |
| 438 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 439 | Inst.addOperand(Op: MCOp); |
| 440 | break; |
| 441 | } |
| 442 | case Mips::PseudoDSDIV: { |
| 443 | MCOperand MCOp; |
| 444 | Inst.setOpcode(Mips::DSDIV); |
| 445 | // Operand: rs |
| 446 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 447 | Inst.addOperand(Op: MCOp); |
| 448 | // Operand: rt |
| 449 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 450 | Inst.addOperand(Op: MCOp); |
| 451 | break; |
| 452 | } |
| 453 | case Mips::PseudoDUDIV: { |
| 454 | MCOperand MCOp; |
| 455 | Inst.setOpcode(Mips::DUDIV); |
| 456 | // Operand: rs |
| 457 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 458 | Inst.addOperand(Op: MCOp); |
| 459 | // Operand: rt |
| 460 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 461 | Inst.addOperand(Op: MCOp); |
| 462 | break; |
| 463 | } |
| 464 | case Mips::PseudoIndirectBranch: { |
| 465 | MCOperand MCOp; |
| 466 | Inst.setOpcode(Mips::JR); |
| 467 | // Operand: rs |
| 468 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 469 | Inst.addOperand(Op: MCOp); |
| 470 | break; |
| 471 | } |
| 472 | case Mips::PseudoIndirectBranch64: { |
| 473 | MCOperand MCOp; |
| 474 | Inst.setOpcode(Mips::JR64); |
| 475 | // Operand: rs |
| 476 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 477 | Inst.addOperand(Op: MCOp); |
| 478 | break; |
| 479 | } |
| 480 | case Mips::PseudoIndirectBranch64R6: { |
| 481 | MCOperand MCOp; |
| 482 | Inst.setOpcode(Mips::JALR64); |
| 483 | // Operand: rd |
| 484 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO_64)); |
| 485 | // Operand: rs |
| 486 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 487 | Inst.addOperand(Op: MCOp); |
| 488 | break; |
| 489 | } |
| 490 | case Mips::PseudoIndirectBranchR6: { |
| 491 | MCOperand MCOp; |
| 492 | Inst.setOpcode(Mips::JALR); |
| 493 | // Operand: rd |
| 494 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO)); |
| 495 | // Operand: rs |
| 496 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 497 | Inst.addOperand(Op: MCOp); |
| 498 | break; |
| 499 | } |
| 500 | case Mips::PseudoIndirectBranch_MM: { |
| 501 | MCOperand MCOp; |
| 502 | Inst.setOpcode(Mips::JR_MM); |
| 503 | // Operand: rs |
| 504 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 505 | Inst.addOperand(Op: MCOp); |
| 506 | break; |
| 507 | } |
| 508 | case Mips::PseudoIndirectBranch_MMR6: { |
| 509 | MCOperand MCOp; |
| 510 | Inst.setOpcode(Mips::JRC16_MMR6); |
| 511 | // Operand: rs |
| 512 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 513 | Inst.addOperand(Op: MCOp); |
| 514 | break; |
| 515 | } |
| 516 | case Mips::PseudoIndirectHazardBranch: { |
| 517 | MCOperand MCOp; |
| 518 | Inst.setOpcode(Mips::JR_HB); |
| 519 | // Operand: rs |
| 520 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 521 | Inst.addOperand(Op: MCOp); |
| 522 | break; |
| 523 | } |
| 524 | case Mips::PseudoIndirectHazardBranch64: { |
| 525 | MCOperand MCOp; |
| 526 | Inst.setOpcode(Mips::JR_HB64); |
| 527 | // Operand: rs |
| 528 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 529 | Inst.addOperand(Op: MCOp); |
| 530 | break; |
| 531 | } |
| 532 | case Mips::PseudoIndrectHazardBranch64R6: { |
| 533 | MCOperand MCOp; |
| 534 | Inst.setOpcode(Mips::JR_HB64_R6); |
| 535 | // Operand: rs |
| 536 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 537 | Inst.addOperand(Op: MCOp); |
| 538 | break; |
| 539 | } |
| 540 | case Mips::PseudoIndrectHazardBranchR6: { |
| 541 | MCOperand MCOp; |
| 542 | Inst.setOpcode(Mips::JR_HB_R6); |
| 543 | // Operand: rs |
| 544 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 545 | Inst.addOperand(Op: MCOp); |
| 546 | break; |
| 547 | } |
| 548 | case Mips::PseudoMADD: { |
| 549 | MCOperand MCOp; |
| 550 | Inst.setOpcode(Mips::MADD); |
| 551 | // Operand: rs |
| 552 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 553 | Inst.addOperand(Op: MCOp); |
| 554 | // Operand: rt |
| 555 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 556 | Inst.addOperand(Op: MCOp); |
| 557 | break; |
| 558 | } |
| 559 | case Mips::PseudoMADDU: { |
| 560 | MCOperand MCOp; |
| 561 | Inst.setOpcode(Mips::MADDU); |
| 562 | // Operand: rs |
| 563 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 564 | Inst.addOperand(Op: MCOp); |
| 565 | // Operand: rt |
| 566 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 567 | Inst.addOperand(Op: MCOp); |
| 568 | break; |
| 569 | } |
| 570 | case Mips::PseudoMADDU_MM: { |
| 571 | MCOperand MCOp; |
| 572 | Inst.setOpcode(Mips::MADDU); |
| 573 | // Operand: rs |
| 574 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 575 | Inst.addOperand(Op: MCOp); |
| 576 | // Operand: rt |
| 577 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 578 | Inst.addOperand(Op: MCOp); |
| 579 | break; |
| 580 | } |
| 581 | case Mips::PseudoMADD_MM: { |
| 582 | MCOperand MCOp; |
| 583 | Inst.setOpcode(Mips::MADD); |
| 584 | // Operand: rs |
| 585 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 586 | Inst.addOperand(Op: MCOp); |
| 587 | // Operand: rt |
| 588 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 589 | Inst.addOperand(Op: MCOp); |
| 590 | break; |
| 591 | } |
| 592 | case Mips::PseudoMSUB: { |
| 593 | MCOperand MCOp; |
| 594 | Inst.setOpcode(Mips::MSUB); |
| 595 | // Operand: rs |
| 596 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 597 | Inst.addOperand(Op: MCOp); |
| 598 | // Operand: rt |
| 599 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 600 | Inst.addOperand(Op: MCOp); |
| 601 | break; |
| 602 | } |
| 603 | case Mips::PseudoMSUBU: { |
| 604 | MCOperand MCOp; |
| 605 | Inst.setOpcode(Mips::MSUBU); |
| 606 | // Operand: rs |
| 607 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 608 | Inst.addOperand(Op: MCOp); |
| 609 | // Operand: rt |
| 610 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 611 | Inst.addOperand(Op: MCOp); |
| 612 | break; |
| 613 | } |
| 614 | case Mips::PseudoMSUBU_MM: { |
| 615 | MCOperand MCOp; |
| 616 | Inst.setOpcode(Mips::MSUBU); |
| 617 | // Operand: rs |
| 618 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 619 | Inst.addOperand(Op: MCOp); |
| 620 | // Operand: rt |
| 621 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 622 | Inst.addOperand(Op: MCOp); |
| 623 | break; |
| 624 | } |
| 625 | case Mips::PseudoMSUB_MM: { |
| 626 | MCOperand MCOp; |
| 627 | Inst.setOpcode(Mips::MSUB); |
| 628 | // Operand: rs |
| 629 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 630 | Inst.addOperand(Op: MCOp); |
| 631 | // Operand: rt |
| 632 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 633 | Inst.addOperand(Op: MCOp); |
| 634 | break; |
| 635 | } |
| 636 | case Mips::PseudoMULT: { |
| 637 | MCOperand MCOp; |
| 638 | Inst.setOpcode(Mips::MULT); |
| 639 | // Operand: rs |
| 640 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 641 | Inst.addOperand(Op: MCOp); |
| 642 | // Operand: rt |
| 643 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 644 | Inst.addOperand(Op: MCOp); |
| 645 | break; |
| 646 | } |
| 647 | case Mips::PseudoMULT_MM: { |
| 648 | MCOperand MCOp; |
| 649 | Inst.setOpcode(Mips::MULT); |
| 650 | // Operand: rs |
| 651 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 652 | Inst.addOperand(Op: MCOp); |
| 653 | // Operand: rt |
| 654 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 655 | Inst.addOperand(Op: MCOp); |
| 656 | break; |
| 657 | } |
| 658 | case Mips::PseudoMULTu: { |
| 659 | MCOperand MCOp; |
| 660 | Inst.setOpcode(Mips::MULTu); |
| 661 | // Operand: rs |
| 662 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 663 | Inst.addOperand(Op: MCOp); |
| 664 | // Operand: rt |
| 665 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 666 | Inst.addOperand(Op: MCOp); |
| 667 | break; |
| 668 | } |
| 669 | case Mips::PseudoMULTu_MM: { |
| 670 | MCOperand MCOp; |
| 671 | Inst.setOpcode(Mips::MULTu); |
| 672 | // Operand: rs |
| 673 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 674 | Inst.addOperand(Op: MCOp); |
| 675 | // Operand: rt |
| 676 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 677 | Inst.addOperand(Op: MCOp); |
| 678 | break; |
| 679 | } |
| 680 | case Mips::PseudoPICK_PH: { |
| 681 | MCOperand MCOp; |
| 682 | Inst.setOpcode(Mips::PICK_PH); |
| 683 | // Operand: rd |
| 684 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 685 | Inst.addOperand(Op: MCOp); |
| 686 | // Operand: rs |
| 687 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 688 | Inst.addOperand(Op: MCOp); |
| 689 | // Operand: rt |
| 690 | lowerOperand(MO: MI->getOperand(i: 3), MCOp); |
| 691 | Inst.addOperand(Op: MCOp); |
| 692 | break; |
| 693 | } |
| 694 | case Mips::PseudoPICK_QB: { |
| 695 | MCOperand MCOp; |
| 696 | Inst.setOpcode(Mips::PICK_QB); |
| 697 | // Operand: rd |
| 698 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 699 | Inst.addOperand(Op: MCOp); |
| 700 | // Operand: rs |
| 701 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 702 | Inst.addOperand(Op: MCOp); |
| 703 | // Operand: rt |
| 704 | lowerOperand(MO: MI->getOperand(i: 3), MCOp); |
| 705 | Inst.addOperand(Op: MCOp); |
| 706 | break; |
| 707 | } |
| 708 | case Mips::PseudoSDIV: { |
| 709 | MCOperand MCOp; |
| 710 | Inst.setOpcode(Mips::SDIV); |
| 711 | // Operand: rs |
| 712 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 713 | Inst.addOperand(Op: MCOp); |
| 714 | // Operand: rt |
| 715 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 716 | Inst.addOperand(Op: MCOp); |
| 717 | break; |
| 718 | } |
| 719 | case Mips::PseudoUDIV: { |
| 720 | MCOperand MCOp; |
| 721 | Inst.setOpcode(Mips::UDIV); |
| 722 | // Operand: rs |
| 723 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 724 | Inst.addOperand(Op: MCOp); |
| 725 | // Operand: rt |
| 726 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 727 | Inst.addOperand(Op: MCOp); |
| 728 | break; |
| 729 | } |
| 730 | case Mips::SDIV_MM_Pseudo: { |
| 731 | MCOperand MCOp; |
| 732 | Inst.setOpcode(Mips::SDIV_MM); |
| 733 | // Operand: rs |
| 734 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 735 | Inst.addOperand(Op: MCOp); |
| 736 | // Operand: rt |
| 737 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 738 | Inst.addOperand(Op: MCOp); |
| 739 | break; |
| 740 | } |
| 741 | case Mips::TAILCALL: { |
| 742 | MCOperand MCOp; |
| 743 | Inst.setOpcode(Mips::J); |
| 744 | // Operand: target |
| 745 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 746 | Inst.addOperand(Op: MCOp); |
| 747 | break; |
| 748 | } |
| 749 | case Mips::TAILCALL64R6REG: { |
| 750 | MCOperand MCOp; |
| 751 | Inst.setOpcode(Mips::JALR64); |
| 752 | // Operand: rd |
| 753 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO_64)); |
| 754 | // Operand: rs |
| 755 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 756 | Inst.addOperand(Op: MCOp); |
| 757 | break; |
| 758 | } |
| 759 | case Mips::TAILCALLHB64R6REG: { |
| 760 | MCOperand MCOp; |
| 761 | Inst.setOpcode(Mips::JR_HB64_R6); |
| 762 | // Operand: rs |
| 763 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 764 | Inst.addOperand(Op: MCOp); |
| 765 | break; |
| 766 | } |
| 767 | case Mips::TAILCALLHBR6REG: { |
| 768 | MCOperand MCOp; |
| 769 | Inst.setOpcode(Mips::JR_HB_R6); |
| 770 | // Operand: rs |
| 771 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 772 | Inst.addOperand(Op: MCOp); |
| 773 | break; |
| 774 | } |
| 775 | case Mips::TAILCALLR6REG: { |
| 776 | MCOperand MCOp; |
| 777 | Inst.setOpcode(Mips::JALR); |
| 778 | // Operand: rd |
| 779 | Inst.addOperand(Op: MCOperand::createReg(Reg: Mips::ZERO)); |
| 780 | // Operand: rs |
| 781 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 782 | Inst.addOperand(Op: MCOp); |
| 783 | break; |
| 784 | } |
| 785 | case Mips::TAILCALLREG: { |
| 786 | MCOperand MCOp; |
| 787 | Inst.setOpcode(Mips::JR); |
| 788 | // Operand: rs |
| 789 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 790 | Inst.addOperand(Op: MCOp); |
| 791 | break; |
| 792 | } |
| 793 | case Mips::TAILCALLREG64: { |
| 794 | MCOperand MCOp; |
| 795 | Inst.setOpcode(Mips::JR64); |
| 796 | // Operand: rs |
| 797 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 798 | Inst.addOperand(Op: MCOp); |
| 799 | break; |
| 800 | } |
| 801 | case Mips::TAILCALLREGHB: { |
| 802 | MCOperand MCOp; |
| 803 | Inst.setOpcode(Mips::JR_HB); |
| 804 | // Operand: rs |
| 805 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 806 | Inst.addOperand(Op: MCOp); |
| 807 | break; |
| 808 | } |
| 809 | case Mips::TAILCALLREGHB64: { |
| 810 | MCOperand MCOp; |
| 811 | Inst.setOpcode(Mips::JR_HB64); |
| 812 | // Operand: rs |
| 813 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 814 | Inst.addOperand(Op: MCOp); |
| 815 | break; |
| 816 | } |
| 817 | case Mips::TAILCALLREG_MM: { |
| 818 | MCOperand MCOp; |
| 819 | Inst.setOpcode(Mips::JRC16_MM); |
| 820 | // Operand: rs |
| 821 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 822 | Inst.addOperand(Op: MCOp); |
| 823 | break; |
| 824 | } |
| 825 | case Mips::TAILCALLREG_MMR6: { |
| 826 | MCOperand MCOp; |
| 827 | Inst.setOpcode(Mips::JRC16_MM); |
| 828 | // Operand: rs |
| 829 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 830 | Inst.addOperand(Op: MCOp); |
| 831 | break; |
| 832 | } |
| 833 | case Mips::TAILCALL_MM: { |
| 834 | MCOperand MCOp; |
| 835 | Inst.setOpcode(Mips::J_MM); |
| 836 | // Operand: target |
| 837 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 838 | Inst.addOperand(Op: MCOp); |
| 839 | break; |
| 840 | } |
| 841 | case Mips::TAILCALL_MMR6: { |
| 842 | MCOperand MCOp; |
| 843 | Inst.setOpcode(Mips::BC_MMR6); |
| 844 | // Operand: offset |
| 845 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 846 | Inst.addOperand(Op: MCOp); |
| 847 | break; |
| 848 | } |
| 849 | case Mips::TRAP: { |
| 850 | MCOperand MCOp; |
| 851 | Inst.setOpcode(Mips::BREAK); |
| 852 | // Operand: code_1 |
| 853 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 854 | // Operand: code_2 |
| 855 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 856 | break; |
| 857 | } |
| 858 | case Mips::TRAP_MM: { |
| 859 | MCOperand MCOp; |
| 860 | Inst.setOpcode(Mips::BREAK_MM); |
| 861 | // Operand: code_1 |
| 862 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 863 | // Operand: code_2 |
| 864 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 865 | break; |
| 866 | } |
| 867 | case Mips::UDIV_MM_Pseudo: { |
| 868 | MCOperand MCOp; |
| 869 | Inst.setOpcode(Mips::UDIV_MM); |
| 870 | // Operand: rs |
| 871 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 872 | Inst.addOperand(Op: MCOp); |
| 873 | // Operand: rt |
| 874 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 875 | Inst.addOperand(Op: MCOp); |
| 876 | break; |
| 877 | } |
| 878 | case Mips::XOR_V_D_PSEUDO: { |
| 879 | MCOperand MCOp; |
| 880 | Inst.setOpcode(Mips::XOR_V); |
| 881 | // Operand: wd |
| 882 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 883 | Inst.addOperand(Op: MCOp); |
| 884 | // Operand: ws |
| 885 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 886 | Inst.addOperand(Op: MCOp); |
| 887 | // Operand: wt |
| 888 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 889 | Inst.addOperand(Op: MCOp); |
| 890 | break; |
| 891 | } |
| 892 | case Mips::XOR_V_H_PSEUDO: { |
| 893 | MCOperand MCOp; |
| 894 | Inst.setOpcode(Mips::XOR_V); |
| 895 | // Operand: wd |
| 896 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 897 | Inst.addOperand(Op: MCOp); |
| 898 | // Operand: ws |
| 899 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 900 | Inst.addOperand(Op: MCOp); |
| 901 | // Operand: wt |
| 902 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 903 | Inst.addOperand(Op: MCOp); |
| 904 | break; |
| 905 | } |
| 906 | case Mips::XOR_V_W_PSEUDO: { |
| 907 | MCOperand MCOp; |
| 908 | Inst.setOpcode(Mips::XOR_V); |
| 909 | // Operand: wd |
| 910 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 911 | Inst.addOperand(Op: MCOp); |
| 912 | // Operand: ws |
| 913 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 914 | Inst.addOperand(Op: MCOp); |
| 915 | // Operand: wt |
| 916 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 917 | Inst.addOperand(Op: MCOp); |
| 918 | break; |
| 919 | } |
| 920 | } |
| 921 | return true; |
| 922 | } |
| 923 | |
| 924 | |