OLD | NEW |
1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// | 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 | 313 |
314 void _lwc1(Variable *Value, OperandMIPS32Mem *Mem, RelocOp Reloc = RO_No) { | 314 void _lwc1(Variable *Value, OperandMIPS32Mem *Mem, RelocOp Reloc = RO_No) { |
315 Context.insert<InstMIPS32Lwc1>(Value, Mem, Reloc); | 315 Context.insert<InstMIPS32Lwc1>(Value, Mem, Reloc); |
316 } | 316 } |
317 | 317 |
318 void _lui(Variable *Dest, Operand *Src, RelocOp Reloc = RO_No) { | 318 void _lui(Variable *Dest, Operand *Src, RelocOp Reloc = RO_No) { |
319 Context.insert<InstMIPS32Lui>(Dest, Src, Reloc); | 319 Context.insert<InstMIPS32Lui>(Dest, Src, Reloc); |
320 } | 320 } |
321 | 321 |
| 322 void _mfc1(Variable *Dest, Variable *Src) { |
| 323 Context.insert<InstMIPS32Mfc1>(Dest, Src); |
| 324 } |
| 325 |
| 326 void _mfhi(Variable *Dest, Operand *Src) { |
| 327 Context.insert<InstMIPS32Mfhi>(Dest, Src); |
| 328 } |
| 329 |
| 330 void _mflo(Variable *Dest, Operand *Src) { |
| 331 Context.insert<InstMIPS32Mflo>(Dest, Src); |
| 332 } |
| 333 |
322 void _mov(Variable *Dest, Operand *Src0) { | 334 void _mov(Variable *Dest, Operand *Src0) { |
323 assert(Dest != nullptr); | 335 assert(Dest != nullptr); |
324 // Variable* Src0_ = llvm::dyn_cast<Variable>(Src0); | 336 // Variable* Src0_ = llvm::dyn_cast<Variable>(Src0); |
325 if (llvm::isa<ConstantRelocatable>(Src0)) { | 337 if (llvm::isa<ConstantRelocatable>(Src0)) { |
326 Context.insert<InstMIPS32La>(Dest, Src0); | 338 Context.insert<InstMIPS32La>(Dest, Src0); |
327 } else { | 339 } else { |
328 auto *Instr = Context.insert<InstMIPS32Mov>(Dest, Src0); | 340 auto *Instr = Context.insert<InstMIPS32Mov>(Dest, Src0); |
329 if (Instr->isMultiDest()) { | 341 if (Instr->isMultiDest()) { |
330 // If Instr is multi-dest, then Dest must be a Variable64On32. We add a | 342 // If Instr is multi-dest, then Dest must be a Variable64On32. We add a |
331 // fake-def for Instr.DestHi here. | 343 // fake-def for Instr.DestHi here. |
332 assert(llvm::isa<Variable64On32>(Dest)); | 344 assert(llvm::isa<Variable64On32>(Dest)); |
333 Context.insert<InstFakeDef>(Instr->getDestHi()); | 345 Context.insert<InstFakeDef>(Instr->getDestHi()); |
334 } | 346 } |
335 } | 347 } |
336 } | 348 } |
337 | 349 |
338 void _mov_d(Variable *Dest, Variable *Src) { | 350 void _mov_d(Variable *Dest, Variable *Src) { |
339 Context.insert<InstMIPS32Mov_d>(Dest, Src); | 351 Context.insert<InstMIPS32Mov_d>(Dest, Src); |
340 } | 352 } |
341 | 353 |
342 void _mov_s(Variable *Dest, Variable *Src) { | 354 void _mov_s(Variable *Dest, Variable *Src) { |
343 Context.insert<InstMIPS32Mov_s>(Dest, Src); | 355 Context.insert<InstMIPS32Mov_s>(Dest, Src); |
344 } | 356 } |
345 | 357 |
346 void _movf(Variable *Src0, Variable *Src1, Operand *FCC) { | 358 void _movf(Variable *Src0, Variable *Src1, Operand *FCC) { |
347 Context.insert<InstMIPS32Movf>(Src0, Src1, FCC); | 359 Context.insert<InstMIPS32Movf>(Src0, Src1, FCC); |
348 } | 360 } |
349 | 361 |
| 362 void _movn(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 363 Context.insert<InstMIPS32Movn>(Dest, Src0, Src1); |
| 364 } |
| 365 |
| 366 void _movn_d(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 367 Context.insert<InstMIPS32Movn_d>(Dest, Src0, Src1); |
| 368 } |
| 369 |
| 370 void _movn_s(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 371 Context.insert<InstMIPS32Movn_s>(Dest, Src0, Src1); |
| 372 } |
| 373 |
350 void _movt(Variable *Src0, Variable *Src1, Operand *FCC) { | 374 void _movt(Variable *Src0, Variable *Src1, Operand *FCC) { |
351 Context.insert<InstMIPS32Movt>(Src0, Src1, FCC); | 375 Context.insert<InstMIPS32Movt>(Src0, Src1, FCC); |
352 } | 376 } |
353 | 377 |
354 void _mfc1(Variable *Dest, Variable *Src) { | 378 void _movz(Variable *Dest, Variable *Src0, Variable *Src1) { |
355 Context.insert<InstMIPS32Mfc1>(Dest, Src); | 379 Context.insert<InstMIPS32Movz>(Dest, Src0, Src1); |
356 } | 380 } |
357 | 381 |
358 void _mfhi(Variable *Dest, Operand *Src) { | 382 void _movz_d(Variable *Dest, Variable *Src0, Variable *Src1) { |
359 Context.insert<InstMIPS32Mfhi>(Dest, Src); | 383 Context.insert<InstMIPS32Movz_d>(Dest, Src0, Src1); |
360 } | 384 } |
361 | 385 |
362 void _mflo(Variable *Dest, Operand *Src) { | 386 void _movz_s(Variable *Dest, Variable *Src0, Variable *Src1) { |
363 Context.insert<InstMIPS32Mflo>(Dest, Src); | 387 Context.insert<InstMIPS32Movz_s>(Dest, Src0, Src1); |
364 } | 388 } |
365 | 389 |
366 void _mtc1(Variable *Dest, Variable *Src) { | 390 void _mtc1(Variable *Dest, Variable *Src) { |
367 Context.insert<InstMIPS32Mtc1>(Dest, Src); | 391 Context.insert<InstMIPS32Mtc1>(Dest, Src); |
368 } | 392 } |
369 | 393 |
370 void _mthi(Variable *Dest, Operand *Src) { | 394 void _mthi(Variable *Dest, Operand *Src) { |
371 Context.insert<InstMIPS32Mthi>(Dest, Src); | 395 Context.insert<InstMIPS32Mthi>(Dest, Src); |
372 } | 396 } |
373 | 397 |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 841 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
818 | 842 |
819 private: | 843 private: |
820 ~TargetHeaderMIPS32() = default; | 844 ~TargetHeaderMIPS32() = default; |
821 }; | 845 }; |
822 | 846 |
823 } // end of namespace MIPS32 | 847 } // end of namespace MIPS32 |
824 } // end of namespace Ice | 848 } // end of namespace Ice |
825 | 849 |
826 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 850 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
OLD | NEW |