| OLD | NEW |
| 1 //===- subzero/src/IceInstMIPS32.h - MIPS32 machine instrs --*- C++ -*-----===// | 1 //===- subzero/src/IceInstMIPS32.h - MIPS32 machine instrs --*- 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 #include "IceConditionCodesMIPS32.h" | 22 #include "IceConditionCodesMIPS32.h" |
| 23 #include "IceDefs.h" | 23 #include "IceDefs.h" |
| 24 #include "IceInst.h" | 24 #include "IceInst.h" |
| 25 #include "IceInstMIPS32.def" | 25 #include "IceInstMIPS32.def" |
| 26 #include "IceOperand.h" | 26 #include "IceOperand.h" |
| 27 | 27 |
| 28 namespace Ice { | 28 namespace Ice { |
| 29 namespace MIPS32 { | 29 namespace MIPS32 { |
| 30 | 30 |
| 31 enum RelocOp { RO_No, RO_Hi, RO_Lo }; | 31 enum RelocOp { RO_No, RO_Hi, RO_Lo, RO_Jal }; |
| 32 | 32 |
| 33 inline void emitRelocOp(Ostream &Str, RelocOp Reloc) { | 33 inline void emitRelocOp(Ostream &Str, RelocOp Reloc) { |
| 34 switch (Reloc) { | 34 switch (Reloc) { |
| 35 case RO_No: | 35 default: |
| 36 break; | 36 break; |
| 37 case RO_Hi: | 37 case RO_Hi: |
| 38 Str << "%hi"; | 38 Str << "%hi"; |
| 39 break; | 39 break; |
| 40 case RO_Lo: | 40 case RO_Lo: |
| 41 Str << "%lo"; | 41 Str << "%lo"; |
| 42 break; | 42 break; |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 InstMIPS32 &operator=(const InstMIPS32 &) = delete; | 182 InstMIPS32 &operator=(const InstMIPS32 &) = delete; |
| 183 | 183 |
| 184 public: | 184 public: |
| 185 enum InstKindMIPS32 { | 185 enum InstKindMIPS32 { |
| 186 k__Start = Inst::Target, | 186 k__Start = Inst::Target, |
| 187 Abs_d, | 187 Abs_d, |
| 188 Abs_s, | 188 Abs_s, |
| 189 Add, | 189 Add, |
| 190 Add_d, | 190 Add_d, |
| 191 Add_s, | 191 Add_s, |
| 192 Addi, |
| 192 Addiu, | 193 Addiu, |
| 193 Addu, | 194 Addu, |
| 194 And, | 195 And, |
| 195 Andi, | 196 Andi, |
| 196 Br, | 197 Br, |
| 197 C_eq_d, | 198 C_eq_d, |
| 198 C_eq_s, | 199 C_eq_s, |
| 199 C_ole_d, | 200 C_ole_d, |
| 200 C_ole_s, | 201 C_ole_s, |
| 201 C_olt_d, | 202 C_olt_d, |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 | 1137 |
| 1137 static const char *Opcode; | 1138 static const char *Opcode; |
| 1138 }; | 1139 }; |
| 1139 | 1140 |
| 1140 using InstMIPS32Abs_d = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_d>; | 1141 using InstMIPS32Abs_d = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_d>; |
| 1141 using InstMIPS32Abs_s = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_s>; | 1142 using InstMIPS32Abs_s = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_s>; |
| 1142 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; | 1143 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; |
| 1143 using InstMIPS32Add_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_d>; | 1144 using InstMIPS32Add_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_d>; |
| 1144 using InstMIPS32Add_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_s>; | 1145 using InstMIPS32Add_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_s>; |
| 1145 using InstMIPS32Addu = InstMIPS32ThreeAddrGPR<InstMIPS32::Addu>; | 1146 using InstMIPS32Addu = InstMIPS32ThreeAddrGPR<InstMIPS32::Addu>; |
| 1147 using InstMIPS32Addi = InstMIPS32Imm16<InstMIPS32::Addi, true>; |
| 1146 using InstMIPS32Addiu = InstMIPS32Imm16<InstMIPS32::Addiu, true>; | 1148 using InstMIPS32Addiu = InstMIPS32Imm16<InstMIPS32::Addiu, true>; |
| 1147 using InstMIPS32And = InstMIPS32ThreeAddrGPR<InstMIPS32::And>; | 1149 using InstMIPS32And = InstMIPS32ThreeAddrGPR<InstMIPS32::And>; |
| 1148 using InstMIPS32Andi = InstMIPS32Imm16<InstMIPS32::Andi>; | 1150 using InstMIPS32Andi = InstMIPS32Imm16<InstMIPS32::Andi>; |
| 1149 using InstMIPS32C_eq_d = InstMIPS32FPCmp<InstMIPS32::C_eq_d>; | 1151 using InstMIPS32C_eq_d = InstMIPS32FPCmp<InstMIPS32::C_eq_d>; |
| 1150 using InstMIPS32C_eq_s = InstMIPS32FPCmp<InstMIPS32::C_eq_s>; | 1152 using InstMIPS32C_eq_s = InstMIPS32FPCmp<InstMIPS32::C_eq_s>; |
| 1151 using InstMIPS32C_ole_d = InstMIPS32FPCmp<InstMIPS32::C_ole_d>; | 1153 using InstMIPS32C_ole_d = InstMIPS32FPCmp<InstMIPS32::C_ole_d>; |
| 1152 using InstMIPS32C_ole_s = InstMIPS32FPCmp<InstMIPS32::C_ole_s>; | 1154 using InstMIPS32C_ole_s = InstMIPS32FPCmp<InstMIPS32::C_ole_s>; |
| 1153 using InstMIPS32C_olt_d = InstMIPS32FPCmp<InstMIPS32::C_olt_d>; | 1155 using InstMIPS32C_olt_d = InstMIPS32FPCmp<InstMIPS32::C_olt_d>; |
| 1154 using InstMIPS32C_olt_s = InstMIPS32FPCmp<InstMIPS32::C_olt_s>; | 1156 using InstMIPS32C_olt_s = InstMIPS32FPCmp<InstMIPS32::C_olt_s>; |
| 1155 using InstMIPS32C_ueq_d = InstMIPS32FPCmp<InstMIPS32::C_ueq_d>; | 1157 using InstMIPS32C_ueq_d = InstMIPS32FPCmp<InstMIPS32::C_ueq_d>; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 }; | 1265 }; |
| 1264 | 1266 |
| 1265 // Declare partial template specializations of emit() methods that already have | 1267 // Declare partial template specializations of emit() methods that already have |
| 1266 // default implementations. Without this, there is the possibility of ODR | 1268 // default implementations. Without this, there is the possibility of ODR |
| 1267 // violations and link errors. | 1269 // violations and link errors. |
| 1268 | 1270 |
| 1269 template <> void InstMIPS32Abs_d::emitIAS(const Cfg *Func) const; | 1271 template <> void InstMIPS32Abs_d::emitIAS(const Cfg *Func) const; |
| 1270 template <> void InstMIPS32Abs_s::emitIAS(const Cfg *Func) const; | 1272 template <> void InstMIPS32Abs_s::emitIAS(const Cfg *Func) const; |
| 1271 template <> void InstMIPS32Add_d::emitIAS(const Cfg *Func) const; | 1273 template <> void InstMIPS32Add_d::emitIAS(const Cfg *Func) const; |
| 1272 template <> void InstMIPS32Add_s::emitIAS(const Cfg *Func) const; | 1274 template <> void InstMIPS32Add_s::emitIAS(const Cfg *Func) const; |
| 1275 template <> void InstMIPS32Addi::emitIAS(const Cfg *Func) const; |
| 1273 template <> void InstMIPS32Addiu::emitIAS(const Cfg *Func) const; | 1276 template <> void InstMIPS32Addiu::emitIAS(const Cfg *Func) const; |
| 1274 template <> void InstMIPS32Addu::emitIAS(const Cfg *Func) const; | 1277 template <> void InstMIPS32Addu::emitIAS(const Cfg *Func) const; |
| 1275 template <> void InstMIPS32And::emitIAS(const Cfg *Func) const; | 1278 template <> void InstMIPS32And::emitIAS(const Cfg *Func) const; |
| 1276 template <> void InstMIPS32Andi::emitIAS(const Cfg *Func) const; | 1279 template <> void InstMIPS32Andi::emitIAS(const Cfg *Func) const; |
| 1277 template <> void InstMIPS32C_eq_d::emitIAS(const Cfg *Func) const; | 1280 template <> void InstMIPS32C_eq_d::emitIAS(const Cfg *Func) const; |
| 1278 template <> void InstMIPS32C_eq_s::emitIAS(const Cfg *Func) const; | 1281 template <> void InstMIPS32C_eq_s::emitIAS(const Cfg *Func) const; |
| 1279 template <> void InstMIPS32C_ole_d::emitIAS(const Cfg *Func) const; | 1282 template <> void InstMIPS32C_ole_d::emitIAS(const Cfg *Func) const; |
| 1280 template <> void InstMIPS32C_ole_s::emitIAS(const Cfg *Func) const; | 1283 template <> void InstMIPS32C_ole_s::emitIAS(const Cfg *Func) const; |
| 1281 template <> void InstMIPS32C_olt_d::emitIAS(const Cfg *Func) const; | 1284 template <> void InstMIPS32C_olt_d::emitIAS(const Cfg *Func) const; |
| 1282 template <> void InstMIPS32C_olt_s::emitIAS(const Cfg *Func) const; | 1285 template <> void InstMIPS32C_olt_s::emitIAS(const Cfg *Func) const; |
| 1283 template <> void InstMIPS32C_ueq_d::emitIAS(const Cfg *Func) const; | 1286 template <> void InstMIPS32C_ueq_d::emitIAS(const Cfg *Func) const; |
| 1284 template <> void InstMIPS32C_ueq_s::emitIAS(const Cfg *Func) const; | 1287 template <> void InstMIPS32C_ueq_s::emitIAS(const Cfg *Func) const; |
| 1285 template <> void InstMIPS32C_ule_d::emitIAS(const Cfg *Func) const; | 1288 template <> void InstMIPS32C_ule_d::emitIAS(const Cfg *Func) const; |
| 1286 template <> void InstMIPS32C_ule_s::emitIAS(const Cfg *Func) const; | 1289 template <> void InstMIPS32C_ule_s::emitIAS(const Cfg *Func) const; |
| 1287 template <> void InstMIPS32C_ult_d::emitIAS(const Cfg *Func) const; | 1290 template <> void InstMIPS32C_ult_d::emitIAS(const Cfg *Func) const; |
| 1288 template <> void InstMIPS32C_ult_s::emitIAS(const Cfg *Func) const; | 1291 template <> void InstMIPS32C_ult_s::emitIAS(const Cfg *Func) const; |
| 1289 template <> void InstMIPS32C_un_d::emitIAS(const Cfg *Func) const; | 1292 template <> void InstMIPS32C_un_d::emitIAS(const Cfg *Func) const; |
| 1290 template <> void InstMIPS32C_un_s::emitIAS(const Cfg *Func) const; | 1293 template <> void InstMIPS32C_un_s::emitIAS(const Cfg *Func) const; |
| 1291 template <> void InstMIPS32Clz::emitIAS(const Cfg *Func) const; | 1294 template <> void InstMIPS32Clz::emitIAS(const Cfg *Func) const; |
| 1292 template <> void InstMIPS32Cvt_d_l::emitIAS(const Cfg *Func) const; | 1295 template <> void InstMIPS32Cvt_d_l::emitIAS(const Cfg *Func) const; |
| 1293 template <> void InstMIPS32Cvt_d_s::emitIAS(const Cfg *Func) const; | 1296 template <> void InstMIPS32Cvt_d_s::emitIAS(const Cfg *Func) const; |
| 1294 template <> void InstMIPS32Cvt_d_w::emitIAS(const Cfg *Func) const; | 1297 template <> void InstMIPS32Cvt_d_w::emitIAS(const Cfg *Func) const; |
| 1295 template <> void InstMIPS32Cvt_s_d::emitIAS(const Cfg *Func) const; | 1298 template <> void InstMIPS32Cvt_s_d::emitIAS(const Cfg *Func) const; |
| 1296 template <> void InstMIPS32Cvt_s_l::emitIAS(const Cfg *Func) const; | 1299 template <> void InstMIPS32Cvt_s_l::emitIAS(const Cfg *Func) const; |
| 1297 template <> void InstMIPS32Cvt_s_w::emitIAS(const Cfg *Func) const; | 1300 template <> void InstMIPS32Cvt_s_w::emitIAS(const Cfg *Func) const; |
| 1298 template <> void InstMIPS32Div::emitIAS(const Cfg *Func) const; | 1301 template <> void InstMIPS32Div::emitIAS(const Cfg *Func) const; |
| 1299 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const; | 1302 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const; |
| 1300 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const; | 1303 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const; |
| 1301 template <> void InstMIPS32Divu::emitIAS(const Cfg *Func) const; | 1304 template <> void InstMIPS32Divu::emitIAS(const Cfg *Func) const; |
| 1305 template <> void InstMIPS32Ldc1::emitIAS(const Cfg *Func) const; |
| 1302 template <> void InstMIPS32Lui::emit(const Cfg *Func) const; | 1306 template <> void InstMIPS32Lui::emit(const Cfg *Func) const; |
| 1303 template <> void InstMIPS32Lui::emitIAS(const Cfg *Func) const; | 1307 template <> void InstMIPS32Lui::emitIAS(const Cfg *Func) const; |
| 1304 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const; | 1308 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const; |
| 1309 template <> void InstMIPS32Lwc1::emitIAS(const Cfg *Func) const; |
| 1305 template <> void InstMIPS32Mfc1::emitIAS(const Cfg *Func) const; | 1310 template <> void InstMIPS32Mfc1::emitIAS(const Cfg *Func) const; |
| 1306 template <> void InstMIPS32Mflo::emit(const Cfg *Func) const; | 1311 template <> void InstMIPS32Mflo::emit(const Cfg *Func) const; |
| 1307 template <> void InstMIPS32Mflo::emitIAS(const Cfg *Func) const; | 1312 template <> void InstMIPS32Mflo::emitIAS(const Cfg *Func) const; |
| 1308 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; | 1313 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; |
| 1309 template <> void InstMIPS32Mfhi::emitIAS(const Cfg *Func) const; | 1314 template <> void InstMIPS32Mfhi::emitIAS(const Cfg *Func) const; |
| 1310 template <> void InstMIPS32Mov_d::emitIAS(const Cfg *Func) const; | 1315 template <> void InstMIPS32Mov_d::emitIAS(const Cfg *Func) const; |
| 1311 template <> void InstMIPS32Mov_s::emitIAS(const Cfg *Func) const; | 1316 template <> void InstMIPS32Mov_s::emitIAS(const Cfg *Func) const; |
| 1312 template <> void InstMIPS32Movf::emitIAS(const Cfg *Func) const; | 1317 template <> void InstMIPS32Movf::emitIAS(const Cfg *Func) const; |
| 1313 template <> void InstMIPS32Movn::emitIAS(const Cfg *Func) const; | 1318 template <> void InstMIPS32Movn::emitIAS(const Cfg *Func) const; |
| 1314 template <> void InstMIPS32Movn_d::emitIAS(const Cfg *Func) const; | 1319 template <> void InstMIPS32Movn_d::emitIAS(const Cfg *Func) const; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; | 1358 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; |
| 1354 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; | 1359 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; |
| 1355 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; | 1360 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; |
| 1356 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; | 1361 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; |
| 1357 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; | 1362 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; |
| 1358 | 1363 |
| 1359 } // end of namespace MIPS32 | 1364 } // end of namespace MIPS32 |
| 1360 } // end of namespace Ice | 1365 } // end of namespace Ice |
| 1361 | 1366 |
| 1362 #endif // SUBZERO_SRC_ICEINSTMIPS32_H | 1367 #endif // SUBZERO_SRC_ICEINSTMIPS32_H |
| OLD | NEW |