Chromium Code Reviews| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 OperandMIPS32(OperandKindMIPS32 Kind, Type Ty) | 69 OperandMIPS32(OperandKindMIPS32 Kind, Type Ty) |
| 70 : Operand(static_cast<OperandKind>(Kind), Ty) {} | 70 : Operand(static_cast<OperandKind>(Kind), Ty) {} |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 class OperandMIPS32FCC : public OperandMIPS32 { | 73 class OperandMIPS32FCC : public OperandMIPS32 { |
| 74 OperandMIPS32FCC() = delete; | 74 OperandMIPS32FCC() = delete; |
| 75 OperandMIPS32FCC(const OperandMIPS32FCC &) = delete; | 75 OperandMIPS32FCC(const OperandMIPS32FCC &) = delete; |
| 76 OperandMIPS32FCC &operator=(const OperandMIPS32FCC &) = delete; | 76 OperandMIPS32FCC &operator=(const OperandMIPS32FCC &) = delete; |
| 77 | 77 |
| 78 public: | 78 public: |
| 79 enum FCC { FCC0 = 0, FCC1, FCC2, FCC3, FCC4, FCC5, FCC6, FCC7 }; | 79 typedef enum { FCC0 = 0, FCC1, FCC2, FCC3, FCC4, FCC5, FCC6, FCC7 } FCC; |
|
Jim Stichnoth
2016/09/20 00:09:23
Is this change necessary? That pattern is used a
obucinac
2016/09/20 13:24:52
Done.
| |
| 80 static OperandMIPS32FCC *create(Cfg *Func, OperandMIPS32FCC::FCC FCC) { | 80 static OperandMIPS32FCC *create(Cfg *Func, OperandMIPS32FCC::FCC FCC) { |
| 81 return new (Func->allocate<OperandMIPS32FCC>()) OperandMIPS32FCC(FCC); | 81 return new (Func->allocate<OperandMIPS32FCC>()) OperandMIPS32FCC(FCC); |
| 82 } | 82 } |
| 83 | 83 |
| 84 OperandMIPS32FCC::FCC getFCC() const { return FpCondCode; } | |
| 85 | |
| 84 void emit(const Cfg *Func) const override { | 86 void emit(const Cfg *Func) const override { |
| 85 if (!BuildDefs::dump()) | 87 if (!BuildDefs::dump()) |
| 86 return; | 88 return; |
| 87 Ostream &Str = Func->getContext()->getStrEmit(); | 89 Ostream &Str = Func->getContext()->getStrEmit(); |
| 88 Str << "$fcc" << static_cast<uint16_t>(FCC); | 90 Str << "$fcc" << static_cast<uint16_t>(FpCondCode); |
| 89 } | 91 } |
| 90 | 92 |
| 91 static bool classof(const Operand *Operand) { | 93 static bool classof(const Operand *Operand) { |
| 92 return Operand->getKind() == static_cast<OperandKind>(kFCC); | 94 return Operand->getKind() == static_cast<OperandKind>(kFCC); |
| 93 } | 95 } |
| 94 | 96 |
| 95 void dump(const Cfg *Func, Ostream &Str) const override { | 97 void dump(const Cfg *Func, Ostream &Str) const override { |
| 96 (void)Func; | 98 (void)Func; |
| 97 (void)Str; | 99 (void)Str; |
| 98 } | 100 } |
| 99 | 101 |
| 100 private: | 102 private: |
| 101 OperandMIPS32FCC(OperandMIPS32FCC::FCC FCC) | 103 OperandMIPS32FCC(OperandMIPS32FCC::FCC CC) |
| 102 : OperandMIPS32(kFCC, IceType_i32), FCC(FCC){}; | 104 : OperandMIPS32(kFCC, IceType_i32), FpCondCode(CC){}; |
| 103 | 105 |
| 104 const OperandMIPS32FCC::FCC FCC; | 106 const FCC FpCondCode; |
| 105 }; | 107 }; |
| 106 | 108 |
| 107 class OperandMIPS32Mem : public OperandMIPS32 { | 109 class OperandMIPS32Mem : public OperandMIPS32 { |
| 108 OperandMIPS32Mem() = delete; | 110 OperandMIPS32Mem() = delete; |
| 109 OperandMIPS32Mem(const OperandMIPS32Mem &) = delete; | 111 OperandMIPS32Mem(const OperandMIPS32Mem &) = delete; |
| 110 OperandMIPS32Mem &operator=(const OperandMIPS32Mem &) = delete; | 112 OperandMIPS32Mem &operator=(const OperandMIPS32Mem &) = delete; |
| 111 | 113 |
| 112 public: | 114 public: |
| 113 /// Memory operand addressing mode. | 115 /// Memory operand addressing mode. |
| 114 /// The enum value also carries the encoding. | 116 /// The enum value also carries the encoding. |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1172 // violations and link errors. | 1174 // violations and link errors. |
| 1173 | 1175 |
| 1174 template <> void InstMIPS32Abs_d::emitIAS(const Cfg *Func) const; | 1176 template <> void InstMIPS32Abs_d::emitIAS(const Cfg *Func) const; |
| 1175 template <> void InstMIPS32Abs_s::emitIAS(const Cfg *Func) const; | 1177 template <> void InstMIPS32Abs_s::emitIAS(const Cfg *Func) const; |
| 1176 template <> void InstMIPS32Add_d::emitIAS(const Cfg *Func) const; | 1178 template <> void InstMIPS32Add_d::emitIAS(const Cfg *Func) const; |
| 1177 template <> void InstMIPS32Add_s::emitIAS(const Cfg *Func) const; | 1179 template <> void InstMIPS32Add_s::emitIAS(const Cfg *Func) const; |
| 1178 template <> void InstMIPS32Addiu::emitIAS(const Cfg *Func) const; | 1180 template <> void InstMIPS32Addiu::emitIAS(const Cfg *Func) const; |
| 1179 template <> void InstMIPS32Addu::emitIAS(const Cfg *Func) const; | 1181 template <> void InstMIPS32Addu::emitIAS(const Cfg *Func) const; |
| 1180 template <> void InstMIPS32And::emitIAS(const Cfg *Func) const; | 1182 template <> void InstMIPS32And::emitIAS(const Cfg *Func) const; |
| 1181 template <> void InstMIPS32Andi::emitIAS(const Cfg *Func) const; | 1183 template <> void InstMIPS32Andi::emitIAS(const Cfg *Func) const; |
| 1184 template <> void InstMIPS32C_eq_d::emitIAS(const Cfg *Func) const; | |
| 1185 template <> void InstMIPS32C_eq_s::emitIAS(const Cfg *Func) const; | |
| 1186 template <> void InstMIPS32C_ole_d::emitIAS(const Cfg *Func) const; | |
| 1187 template <> void InstMIPS32C_ole_s::emitIAS(const Cfg *Func) const; | |
| 1188 template <> void InstMIPS32C_olt_d::emitIAS(const Cfg *Func) const; | |
| 1189 template <> void InstMIPS32C_olt_s::emitIAS(const Cfg *Func) const; | |
| 1190 template <> void InstMIPS32C_ueq_d::emitIAS(const Cfg *Func) const; | |
| 1191 template <> void InstMIPS32C_ueq_s::emitIAS(const Cfg *Func) const; | |
| 1192 template <> void InstMIPS32C_ule_d::emitIAS(const Cfg *Func) const; | |
| 1193 template <> void InstMIPS32C_ule_s::emitIAS(const Cfg *Func) const; | |
| 1194 template <> void InstMIPS32C_ult_d::emitIAS(const Cfg *Func) const; | |
| 1195 template <> void InstMIPS32C_ult_s::emitIAS(const Cfg *Func) const; | |
| 1196 template <> void InstMIPS32C_un_d::emitIAS(const Cfg *Func) const; | |
| 1197 template <> void InstMIPS32C_un_s::emitIAS(const Cfg *Func) const; | |
| 1182 template <> void InstMIPS32Cvt_d_l::emitIAS(const Cfg *Func) const; | 1198 template <> void InstMIPS32Cvt_d_l::emitIAS(const Cfg *Func) const; |
| 1183 template <> void InstMIPS32Cvt_d_s::emitIAS(const Cfg *Func) const; | 1199 template <> void InstMIPS32Cvt_d_s::emitIAS(const Cfg *Func) const; |
| 1184 template <> void InstMIPS32Cvt_d_w::emitIAS(const Cfg *Func) const; | 1200 template <> void InstMIPS32Cvt_d_w::emitIAS(const Cfg *Func) const; |
| 1185 template <> void InstMIPS32Cvt_s_d::emitIAS(const Cfg *Func) const; | 1201 template <> void InstMIPS32Cvt_s_d::emitIAS(const Cfg *Func) const; |
| 1186 template <> void InstMIPS32Cvt_s_l::emitIAS(const Cfg *Func) const; | 1202 template <> void InstMIPS32Cvt_s_l::emitIAS(const Cfg *Func) const; |
| 1187 template <> void InstMIPS32Cvt_s_w::emitIAS(const Cfg *Func) const; | 1203 template <> void InstMIPS32Cvt_s_w::emitIAS(const Cfg *Func) const; |
| 1188 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const; | 1204 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const; |
| 1189 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const; | 1205 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const; |
| 1190 template <> void InstMIPS32Lui::emit(const Cfg *Func) const; | 1206 template <> void InstMIPS32Lui::emit(const Cfg *Func) const; |
| 1191 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const; | 1207 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const; |
| 1192 template <> void InstMIPS32Mfc1::emit(const Cfg *Func) const; | 1208 template <> void InstMIPS32Mfc1::emit(const Cfg *Func) const; |
| 1193 template <> void InstMIPS32Mflo::emit(const Cfg *Func) const; | 1209 template <> void InstMIPS32Mflo::emit(const Cfg *Func) const; |
| 1194 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; | 1210 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; |
| 1195 template <> void InstMIPS32Mov_d::emitIAS(const Cfg *Func) const; | 1211 template <> void InstMIPS32Mov_d::emitIAS(const Cfg *Func) const; |
| 1196 template <> void InstMIPS32Mov_s::emitIAS(const Cfg *Func) const; | 1212 template <> void InstMIPS32Mov_s::emitIAS(const Cfg *Func) const; |
| 1213 template <> void InstMIPS32Movf::emitIAS(const Cfg *Func) const; | |
| 1197 template <> void InstMIPS32Movn_d::emitIAS(const Cfg *Func) const; | 1214 template <> void InstMIPS32Movn_d::emitIAS(const Cfg *Func) const; |
| 1198 template <> void InstMIPS32Movn_s::emitIAS(const Cfg *Func) const; | 1215 template <> void InstMIPS32Movn_s::emitIAS(const Cfg *Func) const; |
| 1216 template <> void InstMIPS32Movt::emitIAS(const Cfg *Func) const; | |
| 1199 template <> void InstMIPS32Movz_d::emitIAS(const Cfg *Func) const; | 1217 template <> void InstMIPS32Movz_d::emitIAS(const Cfg *Func) const; |
| 1200 template <> void InstMIPS32Movz_s::emitIAS(const Cfg *Func) const; | 1218 template <> void InstMIPS32Movz_s::emitIAS(const Cfg *Func) const; |
| 1201 template <> void InstMIPS32Mtc1::emit(const Cfg *Func) const; | 1219 template <> void InstMIPS32Mtc1::emit(const Cfg *Func) const; |
| 1202 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; | 1220 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; |
| 1203 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; | 1221 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; |
| 1204 template <> void InstMIPS32Mul_d::emitIAS(const Cfg *Func) const; | 1222 template <> void InstMIPS32Mul_d::emitIAS(const Cfg *Func) const; |
| 1205 template <> void InstMIPS32Mul_s::emitIAS(const Cfg *Func) const; | 1223 template <> void InstMIPS32Mul_s::emitIAS(const Cfg *Func) const; |
| 1206 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; | 1224 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; |
| 1207 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; | 1225 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; |
| 1208 template <> void InstMIPS32Or::emitIAS(const Cfg *Func) const; | 1226 template <> void InstMIPS32Or::emitIAS(const Cfg *Func) const; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1223 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; | 1241 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; |
| 1224 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; | 1242 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; |
| 1225 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; | 1243 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; |
| 1226 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; | 1244 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; |
| 1227 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; | 1245 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; |
| 1228 | 1246 |
| 1229 } // end of namespace MIPS32 | 1247 } // end of namespace MIPS32 |
| 1230 } // end of namespace Ice | 1248 } // end of namespace Ice |
| 1231 | 1249 |
| 1232 #endif // SUBZERO_SRC_ICEINSTMIPS32_H | 1250 #endif // SUBZERO_SRC_ICEINSTMIPS32_H |
| OLD | NEW |