Chromium Code Reviews| Index: src/IceInstMIPS32.h |
| diff --git a/src/IceInstMIPS32.h b/src/IceInstMIPS32.h |
| index a4660592747bed11cde48086a3f3338e1c19dbcf..97c11a9d69a6202fa627c21824ee0bff0b428dfc 100644 |
| --- a/src/IceInstMIPS32.h |
| +++ b/src/IceInstMIPS32.h |
| @@ -265,6 +265,7 @@ public: |
| Subu, |
| Sw, |
| Swc1, |
| + Teq, |
| Trunc_l_d, |
| Trunc_l_s, |
| Trunc_w_d, |
| @@ -913,6 +914,60 @@ private: |
| static const char *Opcode; |
| }; |
| +// Trap |
| +template <InstMIPS32::InstKindMIPS32 K> |
| +class InstMIPS32Trap : public InstMIPS32 { |
| + InstMIPS32Trap() = delete; |
| + InstMIPS32Trap(const InstMIPS32Trap &) = delete; |
| + InstMIPS32Trap &operator=(const InstMIPS32Trap &) = delete; |
| + |
| +public: |
| + static InstMIPS32Trap *create(Cfg *Func, Operand *Src0, Operand *Src1, |
| + const uint32_t Tcode) { |
| + return new (Func->allocate<InstMIPS32Trap>()) |
| + InstMIPS32Trap(Func, Src0, Src1, Tcode); |
| + } |
| + |
| + void emit(const Cfg *Func) const override { |
| + if (!BuildDefs::dump()) |
| + return; |
| + Ostream &Str = Func->getContext()->getStrEmit(); |
| + Str << "\t" << Opcode << "\t"; |
| + getSrc(0)->emit(Func); |
| + Str << ", "; |
| + getSrc(1)->emit(Func); |
| + Str << ", " << TrapCode; |
| + } |
| + |
| + void emitIAS(const Cfg *Func) const override { |
| + (void)Func; |
| + llvm_unreachable("Not yet implemented"); |
| + } |
| + |
| + void dump(const Cfg *Func) const override { |
| + if (!BuildDefs::dump()) |
| + return; |
| + Ostream &Str = Func->getContext()->getStrEmit(); |
| + Str << "\t" << Opcode << "\t"; |
| + getSrc(0)->emit(Func); |
| + Str << ", "; |
| + getSrc(1)->emit(Func); |
| + Str << ", " << TrapCode; |
| + } |
| + |
| + static bool classof(const Inst *Inst) { return isClassof(Inst, K); } |
| + |
| +private: |
| + InstMIPS32Trap(Cfg *Func, Operand *Src0, Operand *Src1, const uint32_t Tcode) |
| + : InstMIPS32(Func, K, 2, nullptr), TrapCode(Tcode) { |
| + addSource(Src0); |
| + addSource(Src1); |
| + } |
| + |
| + static const char *Opcode; |
| + const uint32_t TrapCode; |
| +}; |
| + |
| template <InstMIPS32::InstKindMIPS32 K, bool Signed = false> |
| class InstMIPS32Imm16 : public InstMIPS32 { |
| InstMIPS32Imm16() = delete; |
| @@ -1127,6 +1182,7 @@ using InstMIPS32Trunc_w_s = InstMIPS32TwoAddrFPR<InstMIPS32::Trunc_w_s>; |
| using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; |
| using InstMIPS32Xor = InstMIPS32ThreeAddrGPR<InstMIPS32::Xor>; |
| using InstMIPS32Xori = InstMIPS32Imm16<InstMIPS32::Xori>; |
| +using InstMIPS32Teq = InstMIPS32Trap<InstMIPS32::Teq>; |
|
obucinac
2016/09/16 10:30:42
Alphabetize
jaydeep.patil
2016/09/16 10:39:07
Done.
|
| /// Handles (some of) vmov's various formats. |
| class InstMIPS32Mov final : public InstMIPS32 { |