| 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.
|
|
|