Chromium Code Reviews

Side by Side Diff: src/IceInstMIPS32.h

Issue 2404803002: [Subzero][MIPS32] Implement bitcast operation for both 32-bit and 64-bit operands (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | src/IceInstMIPS32.cpp » ('j') | src/IceTargetLoweringMIPS32.cpp » ('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 1182 matching lines...)
1193 using InstMIPS32Xor = InstMIPS32ThreeAddrGPR<InstMIPS32::Xor>; 1193 using InstMIPS32Xor = InstMIPS32ThreeAddrGPR<InstMIPS32::Xor>;
1194 using InstMIPS32Xori = InstMIPS32Imm16<InstMIPS32::Xori>; 1194 using InstMIPS32Xori = InstMIPS32Imm16<InstMIPS32::Xori>;
1195 1195
1196 /// Handles (some of) vmov's various formats. 1196 /// Handles (some of) vmov's various formats.
1197 class InstMIPS32Mov final : public InstMIPS32 { 1197 class InstMIPS32Mov final : public InstMIPS32 {
1198 InstMIPS32Mov() = delete; 1198 InstMIPS32Mov() = delete;
1199 InstMIPS32Mov(const InstMIPS32Mov &) = delete; 1199 InstMIPS32Mov(const InstMIPS32Mov &) = delete;
1200 InstMIPS32Mov &operator=(const InstMIPS32Mov &) = delete; 1200 InstMIPS32Mov &operator=(const InstMIPS32Mov &) = delete;
1201 1201
1202 public: 1202 public:
1203 static InstMIPS32Mov *create(Cfg *Func, Variable *Dest, Operand *Src) { 1203 static InstMIPS32Mov *create(Cfg *Func, Variable *Dest, Operand *Src,
1204 return new (Func->allocate<InstMIPS32Mov>()) InstMIPS32Mov(Func, Dest, Src); 1204 Operand *Src2) {
1205 return new (Func->allocate<InstMIPS32Mov>())
1206 InstMIPS32Mov(Func, Dest, Src, Src2);
1205 } 1207 }
1208
1206 bool isRedundantAssign() const override { 1209 bool isRedundantAssign() const override {
1207 return !isMultiDest() && !isMultiSource() && 1210 return !isMultiDest() && !isMultiSource() &&
1208 checkForRedundantAssign(getDest(), getSrc(0)); 1211 checkForRedundantAssign(getDest(), getSrc(0));
1209 } 1212 }
1210 // bool isSimpleAssign() const override { return true; } 1213 // bool isSimpleAssign() const override { return true; }
1211 void emit(const Cfg *Func) const override; 1214 void emit(const Cfg *Func) const override;
1212 void emitIAS(const Cfg *Func) const override; 1215 void emitIAS(const Cfg *Func) const override;
1213 void dump(const Cfg *Func) const override; 1216 void dump(const Cfg *Func) const override;
1214 static bool classof(const Inst *Inst) { return isClassof(Inst, Mov); } 1217 static bool classof(const Inst *Inst) { return isClassof(Inst, Mov); }
1215 1218
1216 bool isMultiDest() const { return DestHi != nullptr; } 1219 bool isMultiDest() const { return false; }
Jim Stichnoth 2016/10/10 17:07:49 Are these meant to be permanent changes? (i.e. is
sagar.thakur 2016/10/12 06:07:06 Yes, a mov instruction will always have single des
1217 1220
1218 bool isMultiSource() const { 1221 bool isMultiSource() const { return false; }
1219 assert(getSrcSize() == 1 || getSrcSize() == 2);
1220 return getSrcSize() == 2;
1221 }
1222 1222
1223 Variable *getDestHi() const { return DestHi; } 1223 Variable *getDestHi() const { return DestHi; }
1224 1224
1225 private: 1225 private:
1226 InstMIPS32Mov(Cfg *Func, Variable *Dest, Operand *Src); 1226 InstMIPS32Mov(Cfg *Func, Variable *Dest, Operand *Src, Operand *Src2);
1227 1227
1228 void emitMultiDestSingleSource(const Cfg *Func) const; 1228 void emitMultiDestSingleSource(const Cfg *Func) const;
1229 void emitSingleDestMultiSource(const Cfg *Func) const; 1229 void emitSingleDestMultiSource(const Cfg *Func) const;
1230 void emitSingleDestSingleSource(const Cfg *Func) const; 1230 void emitSingleDestSingleSource(const Cfg *Func) const;
1231 1231
1232 Variable *DestHi = nullptr; 1232 Variable *DestHi = nullptr;
1233 }; 1233 };
1234 1234
1235 // Declare partial template specializations of emit() methods that already have 1235 // Declare partial template specializations of emit() methods that already have
1236 // default implementations. Without this, there is the possibility of ODR 1236 // default implementations. Without this, there is the possibility of ODR
(...skipping 86 matching lines...)
1323 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const; 1323 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const;
1324 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const; 1324 template <> void InstMIPS32Trunc_w_d::emitIAS(const Cfg *Func) const;
1325 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const; 1325 template <> void InstMIPS32Trunc_w_s::emitIAS(const Cfg *Func) const;
1326 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const; 1326 template <> void InstMIPS32Xor::emitIAS(const Cfg *Func) const;
1327 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const; 1327 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const;
1328 1328
1329 } // end of namespace MIPS32 1329 } // end of namespace MIPS32
1330 } // end of namespace Ice 1330 } // end of namespace Ice
1331 1331
1332 #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.cpp » ('J')

Powered by Google App Engine