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

Unified Diff: src/IceInstMIPS32.h

Issue 2619943003: [SubZero] Fix code generation issues occurred in Cross-test and PNaCL smoke-tests (Closed)
Patch Set: Addressed review comments Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceAssemblerMIPS32.cpp ('k') | src/IceInstMIPS32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstMIPS32.h
diff --git a/src/IceInstMIPS32.h b/src/IceInstMIPS32.h
index 96e6cb714eb75388900d5c2dc2ff73d00d25d904..aaffbcffaaedf2372be93596580c534bd2859eab 100644
--- a/src/IceInstMIPS32.h
+++ b/src/IceInstMIPS32.h
@@ -29,6 +29,7 @@ namespace Ice {
namespace MIPS32 {
enum RelocOp { RO_No, RO_Hi, RO_Lo, RO_Jal };
+enum Int64Part { Int64_Hi, Int64_Lo };
inline void emitRelocOp(Ostream &Str, RelocOp Reloc) {
switch (Reloc) {
@@ -232,6 +233,7 @@ public:
Mfhi,
Mflo,
Mov, // actually a pseudo op for addi rd, rs, 0
+ Mov_fp,
Mov_d,
Mov_s,
Movf,
@@ -1320,6 +1322,44 @@ private:
Variable *DestHi = nullptr;
};
+/// Handle double to i64 move
+class InstMIPS32MovFP64ToI64 final : public InstMIPS32 {
+ InstMIPS32MovFP64ToI64() = delete;
+ InstMIPS32MovFP64ToI64(const InstMIPS32MovFP64ToI64 &) = delete;
+ InstMIPS32MovFP64ToI64 &operator=(const InstMIPS32MovFP64ToI64 &) = delete;
+
+public:
+ static InstMIPS32MovFP64ToI64 *create(Cfg *Func, Variable *Dest, Operand *Src,
+ Int64Part Int64HiLo) {
+ return new (Func->allocate<InstMIPS32MovFP64ToI64>())
+ InstMIPS32MovFP64ToI64(Func, Dest, Src, Int64HiLo);
+ }
+
+ bool isRedundantAssign() const override {
+ return checkForRedundantAssign(getDest(), getSrc(0));
+ }
+
+ void dump(const Cfg *Func) const override {
+ if (!BuildDefs::dump())
+ return;
+ Ostream &Str = Func->getContext()->getStrDump();
+ getDest()->dump(Func);
+ Str << " = ";
+ dumpOpcode(Str, "mov_fp", getDest()->getType());
+ Str << " ";
+ getSrc(0)->dump(Func);
+ }
+
+ Int64Part getInt64Part() const { return Int64HiLo; }
+
+ static bool classof(const Inst *Inst) { return isClassof(Inst, Mov_fp); }
+
+private:
+ InstMIPS32MovFP64ToI64(Cfg *Func, Variable *Dest, Operand *Src,
+ Int64Part Int64HiLo);
+ const Int64Part Int64HiLo;
+};
+
// Declare partial template specializations of emit() methods that already have
// default implementations. Without this, there is the possibility of ODR
// violations and link errors.
« 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