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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return; | 88 return; |
89 Ostream &Str = Func->getContext()->getStrEmit(); | 89 Ostream &Str = Func->getContext()->getStrEmit(); |
90 Str << "$fcc" << static_cast<uint16_t>(FpCondCode); | 90 Str << "$fcc" << static_cast<uint16_t>(FpCondCode); |
91 } | 91 } |
92 | 92 |
93 static bool classof(const Operand *Operand) { | 93 static bool classof(const Operand *Operand) { |
94 return Operand->getKind() == static_cast<OperandKind>(kFCC); | 94 return Operand->getKind() == static_cast<OperandKind>(kFCC); |
95 } | 95 } |
96 | 96 |
97 void dump(const Cfg *Func, Ostream &Str) const override { | 97 void dump(const Cfg *Func, Ostream &Str) const override { |
| 98 if (!BuildDefs::dump()) |
| 99 return; |
98 (void)Func; | 100 (void)Func; |
99 (void)Str; | 101 Str << "$fcc" << static_cast<uint16_t>(FpCondCode); |
100 } | 102 } |
101 | 103 |
102 private: | 104 private: |
103 OperandMIPS32FCC(OperandMIPS32FCC::FCC CC) | 105 OperandMIPS32FCC(OperandMIPS32FCC::FCC CC) |
104 : OperandMIPS32(kFCC, IceType_i32), FpCondCode(CC){}; | 106 : OperandMIPS32(kFCC, IceType_i32), FpCondCode(CC){}; |
105 | 107 |
106 const OperandMIPS32FCC::FCC FpCondCode; | 108 const OperandMIPS32FCC::FCC FpCondCode; |
107 }; | 109 }; |
108 | 110 |
109 class OperandMIPS32Mem : public OperandMIPS32 { | 111 class OperandMIPS32Mem : public OperandMIPS32 { |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 static InstMIPS32MovConditional *create(Cfg *Func, Variable *Dest, | 1057 static InstMIPS32MovConditional *create(Cfg *Func, Variable *Dest, |
1056 Variable *Src, Operand *FCC) { | 1058 Variable *Src, Operand *FCC) { |
1057 return new (Func->allocate<InstMIPS32MovConditional>()) | 1059 return new (Func->allocate<InstMIPS32MovConditional>()) |
1058 InstMIPS32MovConditional(Func, Dest, Src, FCC); | 1060 InstMIPS32MovConditional(Func, Dest, Src, FCC); |
1059 } | 1061 } |
1060 | 1062 |
1061 void emit(const Cfg *Func) const override { | 1063 void emit(const Cfg *Func) const override { |
1062 if (!BuildDefs::dump()) | 1064 if (!BuildDefs::dump()) |
1063 return; | 1065 return; |
1064 Ostream &Str = Func->getContext()->getStrEmit(); | 1066 Ostream &Str = Func->getContext()->getStrEmit(); |
1065 assert(getSrcSize() == 2); | 1067 assert(getSrcSize() == 3); |
1066 Str << "\t" << Opcode << "\t"; | 1068 Str << "\t" << Opcode << "\t"; |
1067 getDest()->emit(Func); | 1069 getDest()->emit(Func); |
1068 Str << ", "; | 1070 Str << ", "; |
1069 getSrc(0)->emit(Func); | 1071 getSrc(1)->emit(Func); |
1070 Str << ", "; | 1072 Str << ", "; |
1071 getSrc(1)->emit(Func); | 1073 getSrc(2)->emit(Func); |
1072 } | 1074 } |
1073 | 1075 |
1074 void emitIAS(const Cfg *Func) const override { | 1076 void emitIAS(const Cfg *Func) const override { |
1075 (void)Func; | 1077 (void)Func; |
1076 llvm_unreachable("Not yet implemented"); | 1078 llvm_unreachable("Not yet implemented"); |
1077 } | 1079 } |
1078 | 1080 |
1079 void dump(const Cfg *Func) const override { | 1081 void dump(const Cfg *Func) const override { |
1080 if (!BuildDefs::dump()) | 1082 if (!BuildDefs::dump()) |
1081 return; | 1083 return; |
1082 Ostream &Str = Func->getContext()->getStrDump(); | 1084 Ostream &Str = Func->getContext()->getStrDump(); |
1083 dumpDest(Func); | 1085 dumpDest(Func); |
1084 Str << " = "; | 1086 Str << " = "; |
1085 dumpOpcode(Str, Opcode, getDest()->getType()); | 1087 dumpOpcode(Str, Opcode, getDest()->getType()); |
1086 Str << " "; | 1088 Str << " "; |
1087 dumpSources(Func); | 1089 dumpSources(Func); |
1088 } | 1090 } |
1089 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } | 1091 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } |
1090 | 1092 |
1091 private: | 1093 private: |
1092 InstMIPS32MovConditional(Cfg *Func, Variable *Dest, Variable *Src, | 1094 InstMIPS32MovConditional(Cfg *Func, Variable *Dest, Variable *Src, |
1093 Operand *FCC) | 1095 Operand *FCC) |
1094 : InstMIPS32(Func, K, 2, Dest) { | 1096 : InstMIPS32(Func, K, 3, Dest) { |
| 1097 addSource(Dest); |
1095 addSource(Src); | 1098 addSource(Src); |
1096 addSource(FCC); | 1099 addSource(FCC); |
1097 } | 1100 } |
1098 | 1101 |
1099 static const char *Opcode; | 1102 static const char *Opcode; |
1100 }; | 1103 }; |
1101 | 1104 |
1102 using InstMIPS32Abs_d = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_d>; | 1105 using InstMIPS32Abs_d = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_d>; |
1103 using InstMIPS32Abs_s = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_s>; | 1106 using InstMIPS32Abs_s = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_s>; |
1104 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; | 1107 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; | 1303 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; |
1301 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; | 1304 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; |
1302 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; | 1305 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; |
1303 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; | 1306 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; |
1304 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; | 1307 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; |
1305 | 1308 |
1306 } // end of namespace MIPS32 | 1309 } // end of namespace MIPS32 |
1307 } // end of namespace Ice | 1310 } // end of namespace Ice |
1308 | 1311 |
1309 #endif // SUBZERO_SRC_ICEINSTMIPS32_H | 1312 #endif // SUBZERO_SRC_ICEINSTMIPS32_H |
OLD | NEW |