Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: src/IceInstMIPS32.h

Issue 2350833002: Subzero, MIPS32: Encoding of FP comparison instructions (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressing review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceAssemblerMIPS32.cpp ('k') | src/IceInstMIPS32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 using FCC = enum { FCC0 = 0, FCC1, FCC2, FCC3, FCC4, FCC5, FCC6, FCC7 };
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 OperandMIPS32FCC::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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 // violations and link errors. 1230 // violations and link errors.
1229 1231
1230 template <> void InstMIPS32Abs_d::emitIAS(const Cfg *Func) const; 1232 template <> void InstMIPS32Abs_d::emitIAS(const Cfg *Func) const;
1231 template <> void InstMIPS32Abs_s::emitIAS(const Cfg *Func) const; 1233 template <> void InstMIPS32Abs_s::emitIAS(const Cfg *Func) const;
1232 template <> void InstMIPS32Add_d::emitIAS(const Cfg *Func) const; 1234 template <> void InstMIPS32Add_d::emitIAS(const Cfg *Func) const;
1233 template <> void InstMIPS32Add_s::emitIAS(const Cfg *Func) const; 1235 template <> void InstMIPS32Add_s::emitIAS(const Cfg *Func) const;
1234 template <> void InstMIPS32Addiu::emitIAS(const Cfg *Func) const; 1236 template <> void InstMIPS32Addiu::emitIAS(const Cfg *Func) const;
1235 template <> void InstMIPS32Addu::emitIAS(const Cfg *Func) const; 1237 template <> void InstMIPS32Addu::emitIAS(const Cfg *Func) const;
1236 template <> void InstMIPS32And::emitIAS(const Cfg *Func) const; 1238 template <> void InstMIPS32And::emitIAS(const Cfg *Func) const;
1237 template <> void InstMIPS32Andi::emitIAS(const Cfg *Func) const; 1239 template <> void InstMIPS32Andi::emitIAS(const Cfg *Func) const;
1240 template <> void InstMIPS32C_eq_d::emitIAS(const Cfg *Func) const;
1241 template <> void InstMIPS32C_eq_s::emitIAS(const Cfg *Func) const;
1242 template <> void InstMIPS32C_ole_d::emitIAS(const Cfg *Func) const;
1243 template <> void InstMIPS32C_ole_s::emitIAS(const Cfg *Func) const;
1244 template <> void InstMIPS32C_olt_d::emitIAS(const Cfg *Func) const;
1245 template <> void InstMIPS32C_olt_s::emitIAS(const Cfg *Func) const;
1246 template <> void InstMIPS32C_ueq_d::emitIAS(const Cfg *Func) const;
1247 template <> void InstMIPS32C_ueq_s::emitIAS(const Cfg *Func) const;
1248 template <> void InstMIPS32C_ule_d::emitIAS(const Cfg *Func) const;
1249 template <> void InstMIPS32C_ule_s::emitIAS(const Cfg *Func) const;
1250 template <> void InstMIPS32C_ult_d::emitIAS(const Cfg *Func) const;
1251 template <> void InstMIPS32C_ult_s::emitIAS(const Cfg *Func) const;
1252 template <> void InstMIPS32C_un_d::emitIAS(const Cfg *Func) const;
1253 template <> void InstMIPS32C_un_s::emitIAS(const Cfg *Func) const;
1238 template <> void InstMIPS32Cvt_d_l::emitIAS(const Cfg *Func) const; 1254 template <> void InstMIPS32Cvt_d_l::emitIAS(const Cfg *Func) const;
1239 template <> void InstMIPS32Cvt_d_s::emitIAS(const Cfg *Func) const; 1255 template <> void InstMIPS32Cvt_d_s::emitIAS(const Cfg *Func) const;
1240 template <> void InstMIPS32Cvt_d_w::emitIAS(const Cfg *Func) const; 1256 template <> void InstMIPS32Cvt_d_w::emitIAS(const Cfg *Func) const;
1241 template <> void InstMIPS32Cvt_s_d::emitIAS(const Cfg *Func) const; 1257 template <> void InstMIPS32Cvt_s_d::emitIAS(const Cfg *Func) const;
1242 template <> void InstMIPS32Cvt_s_l::emitIAS(const Cfg *Func) const; 1258 template <> void InstMIPS32Cvt_s_l::emitIAS(const Cfg *Func) const;
1243 template <> void InstMIPS32Cvt_s_w::emitIAS(const Cfg *Func) const; 1259 template <> void InstMIPS32Cvt_s_w::emitIAS(const Cfg *Func) const;
1244 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const; 1260 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const;
1245 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const; 1261 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const;
1246 template <> void InstMIPS32Lui::emit(const Cfg *Func) const; 1262 template <> void InstMIPS32Lui::emit(const Cfg *Func) const;
1247 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const; 1263 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const;
1248 template <> void InstMIPS32Mfc1::emit(const Cfg *Func) const; 1264 template <> void InstMIPS32Mfc1::emit(const Cfg *Func) const;
1249 template <> void InstMIPS32Mflo::emit(const Cfg *Func) const; 1265 template <> void InstMIPS32Mflo::emit(const Cfg *Func) const;
1250 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; 1266 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const;
1251 template <> void InstMIPS32Mov_d::emitIAS(const Cfg *Func) const; 1267 template <> void InstMIPS32Mov_d::emitIAS(const Cfg *Func) const;
1252 template <> void InstMIPS32Mov_s::emitIAS(const Cfg *Func) const; 1268 template <> void InstMIPS32Mov_s::emitIAS(const Cfg *Func) const;
1269 template <> void InstMIPS32Movf::emitIAS(const Cfg *Func) const;
1253 template <> void InstMIPS32Movn_d::emitIAS(const Cfg *Func) const; 1270 template <> void InstMIPS32Movn_d::emitIAS(const Cfg *Func) const;
1254 template <> void InstMIPS32Movn_s::emitIAS(const Cfg *Func) const; 1271 template <> void InstMIPS32Movn_s::emitIAS(const Cfg *Func) const;
1272 template <> void InstMIPS32Movt::emitIAS(const Cfg *Func) const;
1255 template <> void InstMIPS32Movz_d::emitIAS(const Cfg *Func) const; 1273 template <> void InstMIPS32Movz_d::emitIAS(const Cfg *Func) const;
1256 template <> void InstMIPS32Movz_s::emitIAS(const Cfg *Func) const; 1274 template <> void InstMIPS32Movz_s::emitIAS(const Cfg *Func) const;
1257 template <> void InstMIPS32Mtc1::emit(const Cfg *Func) const; 1275 template <> void InstMIPS32Mtc1::emit(const Cfg *Func) const;
1258 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; 1276 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const;
1259 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; 1277 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const;
1260 template <> void InstMIPS32Mul_d::emitIAS(const Cfg *Func) const; 1278 template <> void InstMIPS32Mul_d::emitIAS(const Cfg *Func) const;
1261 template <> void InstMIPS32Mul_s::emitIAS(const Cfg *Func) const; 1279 template <> void InstMIPS32Mul_s::emitIAS(const Cfg *Func) const;
1262 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; 1280 template <> void InstMIPS32Mult::emit(const Cfg *Func) const;
1263 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; 1281 template <> void InstMIPS32Multu::emit(const Cfg *Func) const;
1264 template <> void InstMIPS32Or::emitIAS(const Cfg *Func) const; 1282 template <> void InstMIPS32Or::emitIAS(const Cfg *Func) const;
(...skipping 14 matching lines...) Expand all
1279 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; 1297 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const;
1280 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; 1298 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const;
1281 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; 1299 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const;
1282 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; 1300 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const;
1283 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; 1301 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const;
1284 1302
1285 } // end of namespace MIPS32 1303 } // end of namespace MIPS32
1286 } // end of namespace Ice 1304 } // end of namespace Ice
1287 1305
1288 #endif // SUBZERO_SRC_ICEINSTMIPS32_H 1306 #endif // SUBZERO_SRC_ICEINSTMIPS32_H
OLDNEW
« no previous file with comments | « src/IceAssemblerMIPS32.cpp ('k') | src/IceInstMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698