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

Side by Side Diff: src/IceInstMIPS32.h

Issue 2394773004: Subzero, MIPS32: Fix conditional mov instructions (Closed)
Patch Set: Fix typo in test file Created 4 years, 2 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 | « no previous file | src/IceInstMIPS32.cpp » ('j') | src/IceTargetLoweringMIPS32.h » ('J')
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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 static InstMIPS32MovConditional *create(Cfg *Func, Variable *Dest, 1058 static InstMIPS32MovConditional *create(Cfg *Func, Variable *Dest,
1059 Variable *Src, Operand *FCC) { 1059 Variable *Src, Operand *FCC) {
1060 return new (Func->allocate<InstMIPS32MovConditional>()) 1060 return new (Func->allocate<InstMIPS32MovConditional>())
1061 InstMIPS32MovConditional(Func, Dest, Src, FCC); 1061 InstMIPS32MovConditional(Func, Dest, Src, FCC);
1062 } 1062 }
1063 1063
1064 void emit(const Cfg *Func) const override { 1064 void emit(const Cfg *Func) const override {
1065 if (!BuildDefs::dump()) 1065 if (!BuildDefs::dump())
1066 return; 1066 return;
1067 Ostream &Str = Func->getContext()->getStrEmit(); 1067 Ostream &Str = Func->getContext()->getStrEmit();
1068 assert(getSrcSize() == 3); 1068 assert(getSrcSize() == 2);
1069 Str << "\t" << Opcode << "\t"; 1069 Str << "\t" << Opcode << "\t";
1070 getDest()->emit(Func); 1070 getDest()->emit(Func);
1071 Str << ", "; 1071 Str << ", ";
1072 getSrc(0)->emit(Func);
1073 Str << ", ";
1072 getSrc(1)->emit(Func); 1074 getSrc(1)->emit(Func);
1073 Str << ", ";
1074 getSrc(2)->emit(Func);
1075 } 1075 }
1076 1076
1077 void emitIAS(const Cfg *Func) const override { 1077 void emitIAS(const Cfg *Func) const override {
1078 (void)Func; 1078 (void)Func;
1079 llvm_unreachable("Not yet implemented"); 1079 llvm_unreachable("Not yet implemented");
1080 } 1080 }
1081 1081
1082 void dump(const Cfg *Func) const override { 1082 void dump(const Cfg *Func) const override {
1083 if (!BuildDefs::dump()) 1083 if (!BuildDefs::dump())
1084 return; 1084 return;
1085 Ostream &Str = Func->getContext()->getStrDump(); 1085 Ostream &Str = Func->getContext()->getStrDump();
1086 dumpDest(Func); 1086 dumpDest(Func);
1087 Str << " = "; 1087 Str << " = ";
1088 dumpOpcode(Str, Opcode, getDest()->getType()); 1088 dumpOpcode(Str, Opcode, getDest()->getType());
1089 Str << " "; 1089 Str << " ";
1090 dumpSources(Func); 1090 dumpSources(Func);
1091 } 1091 }
1092 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 1092 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
1093 1093
1094 private: 1094 private:
1095 InstMIPS32MovConditional(Cfg *Func, Variable *Dest, Variable *Src, 1095 InstMIPS32MovConditional(Cfg *Func, Variable *Dest, Variable *Src,
1096 Operand *FCC) 1096 Operand *FCC)
1097 : InstMIPS32(Func, K, 3, Dest) { 1097 : InstMIPS32(Func, K, 2, Dest) {
1098 addSource(Dest);
1099 addSource(Src); 1098 addSource(Src);
1100 addSource(FCC); 1099 addSource(FCC);
1101 } 1100 }
1102 1101
1103 static const char *Opcode; 1102 static const char *Opcode;
1104 }; 1103 };
1105 1104
1106 using InstMIPS32Abs_d = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_d>; 1105 using InstMIPS32Abs_d = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_d>;
1107 using InstMIPS32Abs_s = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_s>; 1106 using InstMIPS32Abs_s = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_s>;
1108 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; 1107 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 using InstMIPS32Ldc1 = InstMIPS32Load<InstMIPS32::Ldc1>; 1140 using InstMIPS32Ldc1 = InstMIPS32Load<InstMIPS32::Ldc1>;
1142 using InstMIPS32Lui = InstMIPS32UnaryopGPR<InstMIPS32::Lui>; 1141 using InstMIPS32Lui = InstMIPS32UnaryopGPR<InstMIPS32::Lui>;
1143 using InstMIPS32Lw = InstMIPS32Load<InstMIPS32::Lw>; 1142 using InstMIPS32Lw = InstMIPS32Load<InstMIPS32::Lw>;
1144 using InstMIPS32Lwc1 = InstMIPS32Load<InstMIPS32::Lwc1>; 1143 using InstMIPS32Lwc1 = InstMIPS32Load<InstMIPS32::Lwc1>;
1145 using InstMIPS32Mfc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mfc1>; 1144 using InstMIPS32Mfc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mfc1>;
1146 using InstMIPS32Mfhi = InstMIPS32UnaryopGPR<InstMIPS32::Mfhi>; 1145 using InstMIPS32Mfhi = InstMIPS32UnaryopGPR<InstMIPS32::Mfhi>;
1147 using InstMIPS32Mflo = InstMIPS32UnaryopGPR<InstMIPS32::Mflo>; 1146 using InstMIPS32Mflo = InstMIPS32UnaryopGPR<InstMIPS32::Mflo>;
1148 using InstMIPS32Mov_d = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_d>; 1147 using InstMIPS32Mov_d = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_d>;
1149 using InstMIPS32Mov_s = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_s>; 1148 using InstMIPS32Mov_s = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_s>;
1150 using InstMIPS32Movf = InstMIPS32MovConditional<InstMIPS32::Movf>; 1149 using InstMIPS32Movf = InstMIPS32MovConditional<InstMIPS32::Movf>;
1151 using InstMIPS32Movn = InstMIPS32MovConditional<InstMIPS32::Movn>; 1150 using InstMIPS32Movn = InstMIPS32ThreeAddrGPR<InstMIPS32::Movn>;
1152 using InstMIPS32Movn_d = InstMIPS32ThreeAddrGPR<InstMIPS32::Movn_d>; 1151 using InstMIPS32Movn_d = InstMIPS32ThreeAddrGPR<InstMIPS32::Movn_d>;
1153 using InstMIPS32Movn_s = InstMIPS32ThreeAddrGPR<InstMIPS32::Movn_s>; 1152 using InstMIPS32Movn_s = InstMIPS32ThreeAddrGPR<InstMIPS32::Movn_s>;
1154 using InstMIPS32Movt = InstMIPS32MovConditional<InstMIPS32::Movt>; 1153 using InstMIPS32Movt = InstMIPS32MovConditional<InstMIPS32::Movt>;
1155 using InstMIPS32Movz = InstMIPS32MovConditional<InstMIPS32::Movz>; 1154 using InstMIPS32Movz = InstMIPS32ThreeAddrGPR<InstMIPS32::Movz>;
1156 using InstMIPS32Movz_d = InstMIPS32ThreeAddrGPR<InstMIPS32::Movz_d>; 1155 using InstMIPS32Movz_d = InstMIPS32ThreeAddrGPR<InstMIPS32::Movz_d>;
1157 using InstMIPS32Movz_s = InstMIPS32ThreeAddrGPR<InstMIPS32::Movz_s>; 1156 using InstMIPS32Movz_s = InstMIPS32ThreeAddrGPR<InstMIPS32::Movz_s>;
1158 using InstMIPS32Mtc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mtc1>; 1157 using InstMIPS32Mtc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mtc1>;
1159 using InstMIPS32Mthi = InstMIPS32UnaryopGPR<InstMIPS32::Mthi>; 1158 using InstMIPS32Mthi = InstMIPS32UnaryopGPR<InstMIPS32::Mthi>;
1160 using InstMIPS32Mtlo = InstMIPS32UnaryopGPR<InstMIPS32::Mtlo>; 1159 using InstMIPS32Mtlo = InstMIPS32UnaryopGPR<InstMIPS32::Mtlo>;
1161 using InstMIPS32Mul = InstMIPS32ThreeAddrGPR<InstMIPS32::Mul>; 1160 using InstMIPS32Mul = InstMIPS32ThreeAddrGPR<InstMIPS32::Mul>;
1162 using InstMIPS32Mul_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_d>; 1161 using InstMIPS32Mul_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_d>;
1163 using InstMIPS32Mul_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_s>; 1162 using InstMIPS32Mul_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_s>;
1164 using InstMIPS32Mult = InstMIPS32ThreeAddrGPR<InstMIPS32::Mult>; 1163 using InstMIPS32Mult = InstMIPS32ThreeAddrGPR<InstMIPS32::Mult>;
1165 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>; 1164 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; 1323 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const;
1325 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; 1324 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const;
1326 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; 1325 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const;
1327 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; 1326 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const;
1328 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; 1327 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const;
1329 1328
1330 } // end of namespace MIPS32 1329 } // end of namespace MIPS32
1331 } // end of namespace Ice 1330 } // end of namespace Ice
1332 1331
1333 #endif // SUBZERO_SRC_ICEINSTMIPS32_H 1332 #endif // SUBZERO_SRC_ICEINSTMIPS32_H
OLDNEW
« no previous file with comments | « no previous file | src/IceInstMIPS32.cpp » ('j') | src/IceTargetLoweringMIPS32.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698