| 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 RISCVAsmPrinter:: |
| 10 | lowerPseudoInstExpansion(const MachineInstr *MI, MCInst &Inst) { |
| 11 | Inst.clear(); |
| 12 | switch (MI->getOpcode()) { |
| 13 | default: return false; |
| 14 | case RISCV::ClearFCSR: { |
| 15 | MCOperand MCOp; |
| 16 | Inst.setOpcode(RISCV::CSRRC); |
| 17 | // Operand: rd |
| 18 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 19 | // Operand: imm12 |
| 20 | Inst.addOperand(Op: MCOperand::createImm(Val: 3)); |
| 21 | // Operand: rs1 |
| 22 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 23 | Inst.addOperand(Op: MCOp); |
| 24 | break; |
| 25 | } |
| 26 | case RISCV::ClearFCSRImm: { |
| 27 | MCOperand MCOp; |
| 28 | Inst.setOpcode(RISCV::CSRRCI); |
| 29 | // Operand: rd |
| 30 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 31 | // Operand: imm12 |
| 32 | Inst.addOperand(Op: MCOperand::createImm(Val: 3)); |
| 33 | // Operand: rs1 |
| 34 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 35 | Inst.addOperand(Op: MCOp); |
| 36 | break; |
| 37 | } |
| 38 | case RISCV::PseudoBR: { |
| 39 | MCOperand MCOp; |
| 40 | Inst.setOpcode(RISCV::JAL); |
| 41 | // Operand: rd |
| 42 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 43 | // Operand: imm20 |
| 44 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 45 | Inst.addOperand(Op: MCOp); |
| 46 | break; |
| 47 | } |
| 48 | case RISCV::PseudoBRIND: { |
| 49 | MCOperand MCOp; |
| 50 | Inst.setOpcode(RISCV::JALR); |
| 51 | // Operand: rd |
| 52 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 53 | // Operand: rs1 |
| 54 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 55 | Inst.addOperand(Op: MCOp); |
| 56 | // Operand: imm12 |
| 57 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 58 | Inst.addOperand(Op: MCOp); |
| 59 | break; |
| 60 | } |
| 61 | case RISCV::PseudoBRINDNonX7: { |
| 62 | MCOperand MCOp; |
| 63 | Inst.setOpcode(RISCV::JALR); |
| 64 | // Operand: rd |
| 65 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 66 | // Operand: rs1 |
| 67 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 68 | Inst.addOperand(Op: MCOp); |
| 69 | // Operand: imm12 |
| 70 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 71 | Inst.addOperand(Op: MCOp); |
| 72 | break; |
| 73 | } |
| 74 | case RISCV::PseudoBRINDX7: { |
| 75 | MCOperand MCOp; |
| 76 | Inst.setOpcode(RISCV::JALR); |
| 77 | // Operand: rd |
| 78 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 79 | // Operand: rs1 |
| 80 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 81 | Inst.addOperand(Op: MCOp); |
| 82 | // Operand: imm12 |
| 83 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 84 | Inst.addOperand(Op: MCOp); |
| 85 | break; |
| 86 | } |
| 87 | case RISCV::PseudoCALLIndirect: { |
| 88 | MCOperand MCOp; |
| 89 | Inst.setOpcode(RISCV::JALR); |
| 90 | // Operand: rd |
| 91 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X1)); |
| 92 | // Operand: rs1 |
| 93 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 94 | Inst.addOperand(Op: MCOp); |
| 95 | // Operand: imm12 |
| 96 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 97 | break; |
| 98 | } |
| 99 | case RISCV::PseudoCALLIndirectNonX7: { |
| 100 | MCOperand MCOp; |
| 101 | Inst.setOpcode(RISCV::JALR); |
| 102 | // Operand: rd |
| 103 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X1)); |
| 104 | // Operand: rs1 |
| 105 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 106 | Inst.addOperand(Op: MCOp); |
| 107 | // Operand: imm12 |
| 108 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 109 | break; |
| 110 | } |
| 111 | case RISCV::PseudoCALLIndirectX7: { |
| 112 | MCOperand MCOp; |
| 113 | Inst.setOpcode(RISCV::JALR); |
| 114 | // Operand: rd |
| 115 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X1)); |
| 116 | // Operand: rs1 |
| 117 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 118 | Inst.addOperand(Op: MCOp); |
| 119 | // Operand: imm12 |
| 120 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 121 | break; |
| 122 | } |
| 123 | case RISCV::PseudoMOP_C_SSPUSH: { |
| 124 | MCOperand MCOp; |
| 125 | Inst.setOpcode(RISCV::C_SSPUSH); |
| 126 | // Operand: rs1 |
| 127 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X1)); |
| 128 | break; |
| 129 | } |
| 130 | case RISCV::PseudoMOP_SSPOPCHK: { |
| 131 | MCOperand MCOp; |
| 132 | Inst.setOpcode(RISCV::MOP_R_28); |
| 133 | // Operand: rd |
| 134 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 135 | // Operand: rs1 |
| 136 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 137 | Inst.addOperand(Op: MCOp); |
| 138 | break; |
| 139 | } |
| 140 | case RISCV::PseudoMOP_SSPUSH: { |
| 141 | MCOperand MCOp; |
| 142 | Inst.setOpcode(RISCV::MOP_RR_7); |
| 143 | // Operand: rd |
| 144 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 145 | // Operand: rs1 |
| 146 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 147 | // Operand: rs2 |
| 148 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 149 | Inst.addOperand(Op: MCOp); |
| 150 | break; |
| 151 | } |
| 152 | case RISCV::PseudoRET: { |
| 153 | MCOperand MCOp; |
| 154 | Inst.setOpcode(RISCV::JALR); |
| 155 | // Operand: rd |
| 156 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 157 | // Operand: rs1 |
| 158 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X1)); |
| 159 | // Operand: imm12 |
| 160 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 161 | break; |
| 162 | } |
| 163 | case RISCV::PseudoReadVL: { |
| 164 | MCOperand MCOp; |
| 165 | Inst.setOpcode(RISCV::CSRRS); |
| 166 | // Operand: rd |
| 167 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 168 | Inst.addOperand(Op: MCOp); |
| 169 | // Operand: imm12 |
| 170 | Inst.addOperand(Op: MCOperand::createImm(Val: 3104)); |
| 171 | // Operand: rs1 |
| 172 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 173 | break; |
| 174 | } |
| 175 | case RISCV::PseudoReadVLENB: { |
| 176 | MCOperand MCOp; |
| 177 | Inst.setOpcode(RISCV::CSRRS); |
| 178 | // Operand: rd |
| 179 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 180 | Inst.addOperand(Op: MCOp); |
| 181 | // Operand: imm12 |
| 182 | Inst.addOperand(Op: MCOperand::createImm(Val: 3106)); |
| 183 | // Operand: rs1 |
| 184 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 185 | break; |
| 186 | } |
| 187 | case RISCV::PseudoSF_VSETTK: { |
| 188 | MCOperand MCOp; |
| 189 | Inst.setOpcode(RISCV::SF_VSETTK); |
| 190 | // Operand: rd |
| 191 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 192 | Inst.addOperand(Op: MCOp); |
| 193 | // Operand: rs1 |
| 194 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 195 | Inst.addOperand(Op: MCOp); |
| 196 | break; |
| 197 | } |
| 198 | case RISCV::PseudoSF_VSETTM: { |
| 199 | MCOperand MCOp; |
| 200 | Inst.setOpcode(RISCV::SF_VSETTM); |
| 201 | // Operand: rd |
| 202 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 203 | Inst.addOperand(Op: MCOp); |
| 204 | // Operand: rs1 |
| 205 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 206 | Inst.addOperand(Op: MCOp); |
| 207 | break; |
| 208 | } |
| 209 | case RISCV::PseudoSF_VSETTNT: { |
| 210 | MCOperand MCOp; |
| 211 | Inst.setOpcode(RISCV::VSETVLI); |
| 212 | // Operand: rd |
| 213 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 214 | Inst.addOperand(Op: MCOp); |
| 215 | // Operand: rs1 |
| 216 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 217 | Inst.addOperand(Op: MCOp); |
| 218 | // Operand: vtypei |
| 219 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 220 | Inst.addOperand(Op: MCOp); |
| 221 | break; |
| 222 | } |
| 223 | case RISCV::PseudoSF_VSETTNTX0: { |
| 224 | MCOperand MCOp; |
| 225 | Inst.setOpcode(RISCV::VSETVLI); |
| 226 | // Operand: rd |
| 227 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 228 | Inst.addOperand(Op: MCOp); |
| 229 | // Operand: rs1 |
| 230 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 231 | Inst.addOperand(Op: MCOp); |
| 232 | // Operand: vtypei |
| 233 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 234 | Inst.addOperand(Op: MCOp); |
| 235 | break; |
| 236 | } |
| 237 | case RISCV::PseudoSF_VSETTNTX0X0: { |
| 238 | MCOperand MCOp; |
| 239 | Inst.setOpcode(RISCV::VSETVLI); |
| 240 | // Operand: rd |
| 241 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 242 | Inst.addOperand(Op: MCOp); |
| 243 | // Operand: rs1 |
| 244 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 245 | Inst.addOperand(Op: MCOp); |
| 246 | // Operand: vtypei |
| 247 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 248 | Inst.addOperand(Op: MCOp); |
| 249 | break; |
| 250 | } |
| 251 | case RISCV::PseudoTAILIndirect: { |
| 252 | MCOperand MCOp; |
| 253 | Inst.setOpcode(RISCV::JALR); |
| 254 | // Operand: rd |
| 255 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 256 | // Operand: rs1 |
| 257 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 258 | Inst.addOperand(Op: MCOp); |
| 259 | // Operand: imm12 |
| 260 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 261 | break; |
| 262 | } |
| 263 | case RISCV::PseudoTAILIndirectNonX7: { |
| 264 | MCOperand MCOp; |
| 265 | Inst.setOpcode(RISCV::JALR); |
| 266 | // Operand: rd |
| 267 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 268 | // Operand: rs1 |
| 269 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 270 | Inst.addOperand(Op: MCOp); |
| 271 | // Operand: imm12 |
| 272 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 273 | break; |
| 274 | } |
| 275 | case RISCV::PseudoTAILIndirectX7: { |
| 276 | MCOperand MCOp; |
| 277 | Inst.setOpcode(RISCV::JALR); |
| 278 | // Operand: rd |
| 279 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 280 | // Operand: rs1 |
| 281 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 282 | Inst.addOperand(Op: MCOp); |
| 283 | // Operand: imm12 |
| 284 | Inst.addOperand(Op: MCOperand::createImm(Val: 0)); |
| 285 | break; |
| 286 | } |
| 287 | case RISCV::PseudoVSETIVLI: { |
| 288 | MCOperand MCOp; |
| 289 | Inst.setOpcode(RISCV::VSETIVLI); |
| 290 | // Operand: rd |
| 291 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 292 | Inst.addOperand(Op: MCOp); |
| 293 | // Operand: uimm |
| 294 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 295 | Inst.addOperand(Op: MCOp); |
| 296 | // Operand: vtypei |
| 297 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 298 | Inst.addOperand(Op: MCOp); |
| 299 | break; |
| 300 | } |
| 301 | case RISCV::PseudoVSETVLI: { |
| 302 | MCOperand MCOp; |
| 303 | Inst.setOpcode(RISCV::VSETVLI); |
| 304 | // Operand: rd |
| 305 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 306 | Inst.addOperand(Op: MCOp); |
| 307 | // Operand: rs1 |
| 308 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 309 | Inst.addOperand(Op: MCOp); |
| 310 | // Operand: vtypei |
| 311 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 312 | Inst.addOperand(Op: MCOp); |
| 313 | break; |
| 314 | } |
| 315 | case RISCV::PseudoVSETVLIX0: { |
| 316 | MCOperand MCOp; |
| 317 | Inst.setOpcode(RISCV::VSETVLI); |
| 318 | // Operand: rd |
| 319 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 320 | Inst.addOperand(Op: MCOp); |
| 321 | // Operand: rs1 |
| 322 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 323 | Inst.addOperand(Op: MCOp); |
| 324 | // Operand: vtypei |
| 325 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 326 | Inst.addOperand(Op: MCOp); |
| 327 | break; |
| 328 | } |
| 329 | case RISCV::PseudoVSETVLIX0X0: { |
| 330 | MCOperand MCOp; |
| 331 | Inst.setOpcode(RISCV::VSETVLI); |
| 332 | // Operand: rd |
| 333 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 334 | Inst.addOperand(Op: MCOp); |
| 335 | // Operand: rs1 |
| 336 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 337 | Inst.addOperand(Op: MCOp); |
| 338 | // Operand: vtypei |
| 339 | lowerOperand(MO: MI->getOperand(i: 2), MCOp); |
| 340 | Inst.addOperand(Op: MCOp); |
| 341 | break; |
| 342 | } |
| 343 | case RISCV::ReadFCSR: { |
| 344 | MCOperand MCOp; |
| 345 | Inst.setOpcode(RISCV::CSRRS); |
| 346 | // Operand: rd |
| 347 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 348 | Inst.addOperand(Op: MCOp); |
| 349 | // Operand: imm12 |
| 350 | Inst.addOperand(Op: MCOperand::createImm(Val: 3)); |
| 351 | // Operand: rs1 |
| 352 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 353 | break; |
| 354 | } |
| 355 | case RISCV::ReadFFLAGS: { |
| 356 | MCOperand MCOp; |
| 357 | Inst.setOpcode(RISCV::CSRRS); |
| 358 | // Operand: rd |
| 359 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 360 | Inst.addOperand(Op: MCOp); |
| 361 | // Operand: imm12 |
| 362 | Inst.addOperand(Op: MCOperand::createImm(Val: 1)); |
| 363 | // Operand: rs1 |
| 364 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 365 | break; |
| 366 | } |
| 367 | case RISCV::ReadFRM: { |
| 368 | MCOperand MCOp; |
| 369 | Inst.setOpcode(RISCV::CSRRS); |
| 370 | // Operand: rd |
| 371 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 372 | Inst.addOperand(Op: MCOp); |
| 373 | // Operand: imm12 |
| 374 | Inst.addOperand(Op: MCOperand::createImm(Val: 2)); |
| 375 | // Operand: rs1 |
| 376 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 377 | break; |
| 378 | } |
| 379 | case RISCV::SetFCSR: { |
| 380 | MCOperand MCOp; |
| 381 | Inst.setOpcode(RISCV::CSRRS); |
| 382 | // Operand: rd |
| 383 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 384 | // Operand: imm12 |
| 385 | Inst.addOperand(Op: MCOperand::createImm(Val: 3)); |
| 386 | // Operand: rs1 |
| 387 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 388 | Inst.addOperand(Op: MCOp); |
| 389 | break; |
| 390 | } |
| 391 | case RISCV::SetFCSRImm: { |
| 392 | MCOperand MCOp; |
| 393 | Inst.setOpcode(RISCV::CSRRSI); |
| 394 | // Operand: rd |
| 395 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 396 | // Operand: imm12 |
| 397 | Inst.addOperand(Op: MCOperand::createImm(Val: 3)); |
| 398 | // Operand: rs1 |
| 399 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 400 | Inst.addOperand(Op: MCOp); |
| 401 | break; |
| 402 | } |
| 403 | case RISCV::SwapFRMImm: { |
| 404 | MCOperand MCOp; |
| 405 | Inst.setOpcode(RISCV::CSRRWI); |
| 406 | // Operand: rd |
| 407 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 408 | Inst.addOperand(Op: MCOp); |
| 409 | // Operand: imm12 |
| 410 | Inst.addOperand(Op: MCOperand::createImm(Val: 2)); |
| 411 | // Operand: rs1 |
| 412 | lowerOperand(MO: MI->getOperand(i: 1), MCOp); |
| 413 | Inst.addOperand(Op: MCOp); |
| 414 | break; |
| 415 | } |
| 416 | case RISCV::WriteFCSR: { |
| 417 | MCOperand MCOp; |
| 418 | Inst.setOpcode(RISCV::CSRRW); |
| 419 | // Operand: rd |
| 420 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 421 | // Operand: imm12 |
| 422 | Inst.addOperand(Op: MCOperand::createImm(Val: 3)); |
| 423 | // Operand: rs1 |
| 424 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 425 | Inst.addOperand(Op: MCOp); |
| 426 | break; |
| 427 | } |
| 428 | case RISCV::WriteFCSRImm: { |
| 429 | MCOperand MCOp; |
| 430 | Inst.setOpcode(RISCV::CSRRWI); |
| 431 | // Operand: rd |
| 432 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 433 | // Operand: imm12 |
| 434 | Inst.addOperand(Op: MCOperand::createImm(Val: 3)); |
| 435 | // Operand: rs1 |
| 436 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 437 | Inst.addOperand(Op: MCOp); |
| 438 | break; |
| 439 | } |
| 440 | case RISCV::WriteFFLAGS: { |
| 441 | MCOperand MCOp; |
| 442 | Inst.setOpcode(RISCV::CSRRW); |
| 443 | // Operand: rd |
| 444 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 445 | // Operand: imm12 |
| 446 | Inst.addOperand(Op: MCOperand::createImm(Val: 1)); |
| 447 | // Operand: rs1 |
| 448 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 449 | Inst.addOperand(Op: MCOp); |
| 450 | break; |
| 451 | } |
| 452 | case RISCV::WriteFRM: { |
| 453 | MCOperand MCOp; |
| 454 | Inst.setOpcode(RISCV::CSRRW); |
| 455 | // Operand: rd |
| 456 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 457 | // Operand: imm12 |
| 458 | Inst.addOperand(Op: MCOperand::createImm(Val: 2)); |
| 459 | // Operand: rs1 |
| 460 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 461 | Inst.addOperand(Op: MCOp); |
| 462 | break; |
| 463 | } |
| 464 | case RISCV::WriteFRMImm: { |
| 465 | MCOperand MCOp; |
| 466 | Inst.setOpcode(RISCV::CSRRWI); |
| 467 | // Operand: rd |
| 468 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 469 | // Operand: imm12 |
| 470 | Inst.addOperand(Op: MCOperand::createImm(Val: 2)); |
| 471 | // Operand: rs1 |
| 472 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 473 | Inst.addOperand(Op: MCOp); |
| 474 | break; |
| 475 | } |
| 476 | case RISCV::WriteVXRMImm: { |
| 477 | MCOperand MCOp; |
| 478 | Inst.setOpcode(RISCV::CSRRWI); |
| 479 | // Operand: rd |
| 480 | Inst.addOperand(Op: MCOperand::createReg(Reg: RISCV::X0)); |
| 481 | // Operand: imm12 |
| 482 | Inst.addOperand(Op: MCOperand::createImm(Val: 10)); |
| 483 | // Operand: rs1 |
| 484 | lowerOperand(MO: MI->getOperand(i: 0), MCOp); |
| 485 | Inst.addOperand(Op: MCOp); |
| 486 | break; |
| 487 | } |
| 488 | } |
| 489 | return true; |
| 490 | } |
| 491 | |
| 492 | |