OLD | NEW |
1 //===- subzero/src/IceInstMips32.cpp - Mips32 instruction implementation --===// | 1 //===- subzero/src/IceInstMips32.cpp - Mips32 instruction implementation --===// |
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 template <> const char *InstMIPS32Cvt_d_w::Opcode = "cvt.d.w"; | 90 template <> const char *InstMIPS32Cvt_d_w::Opcode = "cvt.d.w"; |
91 template <> const char *InstMIPS32Cvt_s_d::Opcode = "cvt.s.d"; | 91 template <> const char *InstMIPS32Cvt_s_d::Opcode = "cvt.s.d"; |
92 template <> const char *InstMIPS32Cvt_s_l::Opcode = "cvt.s.l"; | 92 template <> const char *InstMIPS32Cvt_s_l::Opcode = "cvt.s.l"; |
93 template <> const char *InstMIPS32Cvt_s_w::Opcode = "cvt.s.w"; | 93 template <> const char *InstMIPS32Cvt_s_w::Opcode = "cvt.s.w"; |
94 template <> const char *InstMIPS32Div::Opcode = "div"; | 94 template <> const char *InstMIPS32Div::Opcode = "div"; |
95 template <> const char *InstMIPS32Div_d::Opcode = "div.d"; | 95 template <> const char *InstMIPS32Div_d::Opcode = "div.d"; |
96 template <> const char *InstMIPS32Div_s::Opcode = "div.s"; | 96 template <> const char *InstMIPS32Div_s::Opcode = "div.s"; |
97 template <> const char *InstMIPS32Divu::Opcode = "divu"; | 97 template <> const char *InstMIPS32Divu::Opcode = "divu"; |
98 template <> const char *InstMIPS32La::Opcode = "la"; | 98 template <> const char *InstMIPS32La::Opcode = "la"; |
99 template <> const char *InstMIPS32Ldc1::Opcode = "ldc1"; | 99 template <> const char *InstMIPS32Ldc1::Opcode = "ldc1"; |
| 100 template <> const char *InstMIPS32Ll::Opcode = "ll"; |
100 template <> const char *InstMIPS32Lui::Opcode = "lui"; | 101 template <> const char *InstMIPS32Lui::Opcode = "lui"; |
101 template <> const char *InstMIPS32Lw::Opcode = "lw"; | 102 template <> const char *InstMIPS32Lw::Opcode = "lw"; |
102 template <> const char *InstMIPS32Lwc1::Opcode = "lwc1"; | 103 template <> const char *InstMIPS32Lwc1::Opcode = "lwc1"; |
103 template <> const char *InstMIPS32Mfc1::Opcode = "mfc1"; | 104 template <> const char *InstMIPS32Mfc1::Opcode = "mfc1"; |
104 template <> const char *InstMIPS32Mfhi::Opcode = "mfhi"; | 105 template <> const char *InstMIPS32Mfhi::Opcode = "mfhi"; |
105 template <> const char *InstMIPS32Mflo::Opcode = "mflo"; | 106 template <> const char *InstMIPS32Mflo::Opcode = "mflo"; |
106 template <> const char *InstMIPS32Mov_d::Opcode = "mov.d"; | 107 template <> const char *InstMIPS32Mov_d::Opcode = "mov.d"; |
107 template <> const char *InstMIPS32Mov_s::Opcode = "mov.s"; | 108 template <> const char *InstMIPS32Mov_s::Opcode = "mov.s"; |
108 template <> const char *InstMIPS32Movf::Opcode = "movf"; | 109 template <> const char *InstMIPS32Movf::Opcode = "movf"; |
109 template <> const char *InstMIPS32Movn::Opcode = "movn"; | 110 template <> const char *InstMIPS32Movn::Opcode = "movn"; |
110 template <> const char *InstMIPS32Movn_d::Opcode = "movn.d"; | 111 template <> const char *InstMIPS32Movn_d::Opcode = "movn.d"; |
111 template <> const char *InstMIPS32Movn_s::Opcode = "movn.s"; | 112 template <> const char *InstMIPS32Movn_s::Opcode = "movn.s"; |
112 template <> const char *InstMIPS32Movt::Opcode = "movt"; | 113 template <> const char *InstMIPS32Movt::Opcode = "movt"; |
113 template <> const char *InstMIPS32Movz::Opcode = "movz"; | 114 template <> const char *InstMIPS32Movz::Opcode = "movz"; |
114 template <> const char *InstMIPS32Movz_d::Opcode = "movz.d"; | 115 template <> const char *InstMIPS32Movz_d::Opcode = "movz.d"; |
115 template <> const char *InstMIPS32Movz_s::Opcode = "movz.s"; | 116 template <> const char *InstMIPS32Movz_s::Opcode = "movz.s"; |
116 template <> const char *InstMIPS32Mtc1::Opcode = "mtc1"; | 117 template <> const char *InstMIPS32Mtc1::Opcode = "mtc1"; |
117 template <> const char *InstMIPS32Mthi::Opcode = "mthi"; | 118 template <> const char *InstMIPS32Mthi::Opcode = "mthi"; |
118 template <> const char *InstMIPS32Mtlo::Opcode = "mtlo"; | 119 template <> const char *InstMIPS32Mtlo::Opcode = "mtlo"; |
119 template <> const char *InstMIPS32Mul::Opcode = "mul"; | 120 template <> const char *InstMIPS32Mul::Opcode = "mul"; |
120 template <> const char *InstMIPS32Mul_d::Opcode = "mul.d"; | 121 template <> const char *InstMIPS32Mul_d::Opcode = "mul.d"; |
121 template <> const char *InstMIPS32Mul_s::Opcode = "mul.s"; | 122 template <> const char *InstMIPS32Mul_s::Opcode = "mul.s"; |
122 template <> const char *InstMIPS32Mult::Opcode = "mult"; | 123 template <> const char *InstMIPS32Mult::Opcode = "mult"; |
123 template <> const char *InstMIPS32Multu::Opcode = "multu"; | 124 template <> const char *InstMIPS32Multu::Opcode = "multu"; |
124 template <> const char *InstMIPS32Nor::Opcode = "nor"; | 125 template <> const char *InstMIPS32Nor::Opcode = "nor"; |
125 template <> const char *InstMIPS32Or::Opcode = "or"; | 126 template <> const char *InstMIPS32Or::Opcode = "or"; |
126 template <> const char *InstMIPS32Ori::Opcode = "ori"; | 127 template <> const char *InstMIPS32Ori::Opcode = "ori"; |
| 128 template <> const char *InstMIPS32Sc::Opcode = "sc"; |
127 template <> const char *InstMIPS32Sdc1::Opcode = "sdc1"; | 129 template <> const char *InstMIPS32Sdc1::Opcode = "sdc1"; |
128 template <> const char *InstMIPS32Sll::Opcode = "sll"; | 130 template <> const char *InstMIPS32Sll::Opcode = "sll"; |
129 template <> const char *InstMIPS32Sllv::Opcode = "sllv"; | 131 template <> const char *InstMIPS32Sllv::Opcode = "sllv"; |
130 template <> const char *InstMIPS32Slt::Opcode = "slt"; | 132 template <> const char *InstMIPS32Slt::Opcode = "slt"; |
131 template <> const char *InstMIPS32Slti::Opcode = "slti"; | 133 template <> const char *InstMIPS32Slti::Opcode = "slti"; |
132 template <> const char *InstMIPS32Sltiu::Opcode = "sltiu"; | 134 template <> const char *InstMIPS32Sltiu::Opcode = "sltiu"; |
133 template <> const char *InstMIPS32Sltu::Opcode = "sltu"; | 135 template <> const char *InstMIPS32Sltu::Opcode = "sltu"; |
134 template <> const char *InstMIPS32Sqrt_d::Opcode = "sqrt.d"; | 136 template <> const char *InstMIPS32Sqrt_d::Opcode = "sqrt.d"; |
135 template <> const char *InstMIPS32Sqrt_s::Opcode = "sqrt.s"; | 137 template <> const char *InstMIPS32Sqrt_s::Opcode = "sqrt.s"; |
136 template <> const char *InstMIPS32Sra::Opcode = "sra"; | 138 template <> const char *InstMIPS32Sra::Opcode = "sra"; |
137 template <> const char *InstMIPS32Srav::Opcode = "srav"; | 139 template <> const char *InstMIPS32Srav::Opcode = "srav"; |
138 template <> const char *InstMIPS32Srl::Opcode = "srl"; | 140 template <> const char *InstMIPS32Srl::Opcode = "srl"; |
139 template <> const char *InstMIPS32Srlv::Opcode = "srlv"; | 141 template <> const char *InstMIPS32Srlv::Opcode = "srlv"; |
140 template <> const char *InstMIPS32Sub::Opcode = "sub"; | 142 template <> const char *InstMIPS32Sub::Opcode = "sub"; |
141 template <> const char *InstMIPS32Sub_d::Opcode = "sub.d"; | 143 template <> const char *InstMIPS32Sub_d::Opcode = "sub.d"; |
142 template <> const char *InstMIPS32Sub_s::Opcode = "sub.s"; | 144 template <> const char *InstMIPS32Sub_s::Opcode = "sub.s"; |
143 template <> const char *InstMIPS32Subu::Opcode = "subu"; | 145 template <> const char *InstMIPS32Subu::Opcode = "subu"; |
144 template <> const char *InstMIPS32Sw::Opcode = "sw"; | 146 template <> const char *InstMIPS32Sw::Opcode = "sw"; |
145 template <> const char *InstMIPS32Swc1::Opcode = "swc1"; | 147 template <> const char *InstMIPS32Swc1::Opcode = "swc1"; |
| 148 const char *InstMIPS32Sync::Opcode = "sync"; |
146 template <> const char *InstMIPS32Teq::Opcode = "teq"; | 149 template <> const char *InstMIPS32Teq::Opcode = "teq"; |
147 template <> const char *InstMIPS32Trunc_l_d::Opcode = "trunc.l.d"; | 150 template <> const char *InstMIPS32Trunc_l_d::Opcode = "trunc.l.d"; |
148 template <> const char *InstMIPS32Trunc_l_s::Opcode = "trunc.l.s"; | 151 template <> const char *InstMIPS32Trunc_l_s::Opcode = "trunc.l.s"; |
149 template <> const char *InstMIPS32Trunc_w_d::Opcode = "trunc.w.d"; | 152 template <> const char *InstMIPS32Trunc_w_d::Opcode = "trunc.w.d"; |
150 template <> const char *InstMIPS32Trunc_w_s::Opcode = "trunc.w.s"; | 153 template <> const char *InstMIPS32Trunc_w_s::Opcode = "trunc.w.s"; |
151 template <> const char *InstMIPS32Xor::Opcode = "xor"; | 154 template <> const char *InstMIPS32Xor::Opcode = "xor"; |
152 template <> const char *InstMIPS32Xori::Opcode = "xori"; | 155 template <> const char *InstMIPS32Xori::Opcode = "xori"; |
153 | 156 |
154 template <> void InstMIPS32Lui::emit(const Cfg *Func) const { | 157 template <> void InstMIPS32Lui::emit(const Cfg *Func) const { |
155 if (!BuildDefs::dump()) | 158 if (!BuildDefs::dump()) |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 Str << "\t" | 425 Str << "\t" |
423 "jr" | 426 "jr" |
424 "\t"; | 427 "\t"; |
425 RA->emit(Func); | 428 RA->emit(Func); |
426 } | 429 } |
427 | 430 |
428 void InstMIPS32Br::emitIAS(const Cfg *Func) const { | 431 void InstMIPS32Br::emitIAS(const Cfg *Func) const { |
429 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 432 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
430 if (Label != nullptr) { | 433 if (Label != nullptr) { |
431 // Intra-block branches are of kind bcc | 434 // Intra-block branches are of kind bcc |
432 Asm->bcc(Predicate, getSrc(0), getSrc(1), | 435 if (isUnconditionalBranch()) { |
433 Asm->getOrCreateLocalLabel(Label->getNumber())); | 436 Asm->b(Asm->getOrCreateLocalLabel(Label->getNumber())); |
| 437 } else { |
| 438 Asm->bcc(Predicate, getSrc(0), getSrc(1), |
| 439 Asm->getOrCreateLocalLabel(Label->getNumber())); |
| 440 } |
434 } else if (isUnconditionalBranch()) { | 441 } else if (isUnconditionalBranch()) { |
435 Asm->b(Asm->getOrCreateCfgNodeLabel(getTargetFalse()->getIndex())); | 442 Asm->b(Asm->getOrCreateCfgNodeLabel(getTargetFalse()->getIndex())); |
436 } else { | 443 } else { |
437 switch (Predicate) { | 444 switch (Predicate) { |
438 default: | 445 default: |
439 break; | 446 break; |
440 case CondMIPS32::EQ: | 447 case CondMIPS32::EQ: |
441 case CondMIPS32::NE: | 448 case CondMIPS32::NE: |
442 Asm->bcc(Predicate, getSrc(0), getSrc(1), | 449 Asm->bcc(Predicate, getSrc(0), getSrc(1), |
443 Asm->getOrCreateCfgNodeLabel(getTargetFalse()->getIndex())); | 450 Asm->getOrCreateCfgNodeLabel(getTargetFalse()->getIndex())); |
(...skipping 14 matching lines...) Expand all Loading... |
458 } | 465 } |
459 } | 466 } |
460 | 467 |
461 void InstMIPS32Br::emit(const Cfg *Func) const { | 468 void InstMIPS32Br::emit(const Cfg *Func) const { |
462 if (!BuildDefs::dump()) | 469 if (!BuildDefs::dump()) |
463 return; | 470 return; |
464 Ostream &Str = Func->getContext()->getStrEmit(); | 471 Ostream &Str = Func->getContext()->getStrEmit(); |
465 Str << "\t" | 472 Str << "\t" |
466 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; | 473 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; |
467 if (Label != nullptr) { | 474 if (Label != nullptr) { |
468 getSrc(0)->emit(Func); | 475 if (isUnconditionalBranch()) { |
469 Str << ", "; | 476 Str << Label->getLabelName(); |
470 getSrc(1)->emit(Func); | 477 } else { |
471 Str << ", " << Label->getLabelName(); | 478 getSrc(0)->emit(Func); |
| 479 Str << ", "; |
| 480 getSrc(1)->emit(Func); |
| 481 Str << ", " << Label->getLabelName(); |
| 482 } |
472 } else { | 483 } else { |
473 if (isUnconditionalBranch()) { | 484 if (isUnconditionalBranch()) { |
474 Str << getTargetFalse()->getAsmName(); | 485 Str << getTargetFalse()->getAsmName(); |
475 } else { | 486 } else { |
476 switch (Predicate) { | 487 switch (Predicate) { |
477 default: | 488 default: |
478 break; | 489 break; |
479 case CondMIPS32::EQ: | 490 case CondMIPS32::EQ: |
480 case CondMIPS32::NE: { | 491 case CondMIPS32::NE: { |
481 getSrc(0)->emit(Func); | 492 getSrc(0)->emit(Func); |
(...skipping 24 matching lines...) Expand all Loading... |
506 } | 517 } |
507 | 518 |
508 void InstMIPS32Br::dump(const Cfg *Func) const { | 519 void InstMIPS32Br::dump(const Cfg *Func) const { |
509 if (!BuildDefs::dump()) | 520 if (!BuildDefs::dump()) |
510 return; | 521 return; |
511 Ostream &Str = Func->getContext()->getStrDump(); | 522 Ostream &Str = Func->getContext()->getStrDump(); |
512 Str << "\t" | 523 Str << "\t" |
513 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; | 524 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; |
514 | 525 |
515 if (Label != nullptr) { | 526 if (Label != nullptr) { |
516 getSrc(0)->dump(Func); | 527 if (isUnconditionalBranch()) { |
517 Str << ", "; | 528 Str << Label->getLabelName(); |
518 getSrc(1)->dump(Func); | 529 } else { |
519 Str << ", " << Label->getLabelName(); | 530 getSrc(0)->dump(Func); |
| 531 Str << ", "; |
| 532 getSrc(1)->dump(Func); |
| 533 Str << ", " << Label->getLabelName(); |
| 534 } |
520 } else { | 535 } else { |
521 if (isUnconditionalBranch()) { | 536 if (isUnconditionalBranch()) { |
522 Str << getTargetFalse()->getAsmName(); | 537 Str << getTargetFalse()->getAsmName(); |
523 } else { | 538 } else { |
524 dumpSources(Func); | 539 dumpSources(Func); |
525 Str << ", "; | 540 Str << ", "; |
526 Str << getTargetFalse()->getAsmName(); | 541 Str << getTargetFalse()->getAsmName(); |
527 if (getTargetTrue()) { | 542 if (getTargetTrue()) { |
528 Str << "\n\t" | 543 Str << "\n\t" |
529 << "b" | 544 << "b" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 894 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
880 Asm->lui(getDest(), getSrc(0), Reloc); | 895 Asm->lui(getDest(), getSrc(0), Reloc); |
881 } | 896 } |
882 | 897 |
883 template <> void InstMIPS32Ldc1::emitIAS(const Cfg *Func) const { | 898 template <> void InstMIPS32Ldc1::emitIAS(const Cfg *Func) const { |
884 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 899 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
885 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); | 900 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); |
886 Asm->ldc1(getDest(), Mem->getBase(), Mem->getOffset(), Reloc); | 901 Asm->ldc1(getDest(), Mem->getBase(), Mem->getOffset(), Reloc); |
887 } | 902 } |
888 | 903 |
| 904 template <> void InstMIPS32Ll::emitIAS(const Cfg *Func) const { |
| 905 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
| 906 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); |
| 907 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset()); |
| 908 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); |
| 909 Asm->ll(getDest(), Mem->getBase(), Imm); |
| 910 } |
| 911 |
889 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const { | 912 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const { |
890 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 913 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
891 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); | 914 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); |
892 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset()); | 915 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset()); |
893 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); | 916 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); |
894 Asm->lw(getDest(), Mem->getBase(), Imm); | 917 Asm->lw(getDest(), Mem->getBase(), Imm); |
895 } | 918 } |
896 | 919 |
897 template <> void InstMIPS32Lwc1::emitIAS(const Cfg *Func) const { | 920 template <> void InstMIPS32Lwc1::emitIAS(const Cfg *Func) const { |
898 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 921 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 template <> void InstMIPS32Or::emitIAS(const Cfg *Func) const { | 1083 template <> void InstMIPS32Or::emitIAS(const Cfg *Func) const { |
1061 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1084 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1062 Asm->or_(getDest(), getSrc(0), getSrc(1)); | 1085 Asm->or_(getDest(), getSrc(0), getSrc(1)); |
1063 } | 1086 } |
1064 | 1087 |
1065 template <> void InstMIPS32Ori::emitIAS(const Cfg *Func) const { | 1088 template <> void InstMIPS32Ori::emitIAS(const Cfg *Func) const { |
1066 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1089 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1067 Asm->ori(getDest(), getSrc(0), Imm); | 1090 Asm->ori(getDest(), getSrc(0), Imm); |
1068 } | 1091 } |
1069 | 1092 |
| 1093 template <> void InstMIPS32Sc::emitIAS(const Cfg *Func) const { |
| 1094 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
| 1095 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(1)); |
| 1096 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset()); |
| 1097 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); |
| 1098 Asm->sc(getSrc(0), Mem->getBase(), Imm); |
| 1099 } |
| 1100 |
1070 template <> void InstMIPS32Sll::emitIAS(const Cfg *Func) const { | 1101 template <> void InstMIPS32Sll::emitIAS(const Cfg *Func) const { |
1071 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1102 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1072 Asm->sll(getDest(), getSrc(0), Imm); | 1103 Asm->sll(getDest(), getSrc(0), Imm); |
1073 } | 1104 } |
1074 | 1105 |
1075 template <> void InstMIPS32Sllv::emitIAS(const Cfg *Func) const { | 1106 template <> void InstMIPS32Sllv::emitIAS(const Cfg *Func) const { |
1076 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1107 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1077 Asm->sllv(getDest(), getSrc(0), getSrc(1)); | 1108 Asm->sllv(getDest(), getSrc(0), getSrc(1)); |
1078 } | 1109 } |
1079 | 1110 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); | 1186 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); |
1156 Asm->sw(getSrc(0), Mem->getBase(), Imm); | 1187 Asm->sw(getSrc(0), Mem->getBase(), Imm); |
1157 } | 1188 } |
1158 | 1189 |
1159 template <> void InstMIPS32Swc1::emitIAS(const Cfg *Func) const { | 1190 template <> void InstMIPS32Swc1::emitIAS(const Cfg *Func) const { |
1160 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1191 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1161 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); | 1192 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); |
1162 Asm->swc1(getSrc(0), Mem->getBase(), Mem->getOffset(), Reloc); | 1193 Asm->swc1(getSrc(0), Mem->getBase(), Mem->getOffset(), Reloc); |
1163 } | 1194 } |
1164 | 1195 |
| 1196 void InstMIPS32Sync::emitIAS(const Cfg *Func) const { |
| 1197 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
| 1198 Asm->sync(); |
| 1199 } |
| 1200 |
1165 template <> void InstMIPS32Teq::emitIAS(const Cfg *Func) const { | 1201 template <> void InstMIPS32Teq::emitIAS(const Cfg *Func) const { |
1166 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1202 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1167 Asm->teq(getSrc(0), getSrc(1), getTrapCode()); | 1203 Asm->teq(getSrc(0), getSrc(1), getTrapCode()); |
1168 } | 1204 } |
1169 | 1205 |
1170 template <> void InstMIPS32Trunc_l_d::emitIAS(const Cfg *Func) const { | 1206 template <> void InstMIPS32Trunc_l_d::emitIAS(const Cfg *Func) const { |
1171 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1207 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1172 Asm->trunc_l_d(getDest(), getSrc(0)); | 1208 Asm->trunc_l_d(getDest(), getSrc(0)); |
1173 } | 1209 } |
1174 | 1210 |
(...skipping 17 matching lines...) Expand all Loading... |
1192 Asm->xor_(getDest(), getSrc(0), getSrc(1)); | 1228 Asm->xor_(getDest(), getSrc(0), getSrc(1)); |
1193 } | 1229 } |
1194 | 1230 |
1195 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const { | 1231 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const { |
1196 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1232 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1197 Asm->xori(getDest(), getSrc(0), Imm); | 1233 Asm->xori(getDest(), getSrc(0), Imm); |
1198 } | 1234 } |
1199 | 1235 |
1200 } // end of namespace MIPS32 | 1236 } // end of namespace MIPS32 |
1201 } // end of namespace Ice | 1237 } // end of namespace Ice |
OLD | NEW |