Chromium Code Reviews| Index: src/IceInstX8632.h |
| diff --git a/src/IceInstX8632.h b/src/IceInstX8632.h |
| index 8b8a3fde60e6d808d489c93c4074a095c71743e1..90679ef03cb978405843c29761e855f0752b5d2a 100644 |
| --- a/src/IceInstX8632.h |
| +++ b/src/IceInstX8632.h |
| @@ -156,11 +156,14 @@ public: |
| Idiv, |
| Imul, |
| Label, |
| + Lea, |
| Load, |
| Mfence, |
| Mov, |
| + Movd, |
| Movp, |
| Movq, |
| + Movss, |
| Movsx, |
| Movzx, |
| Mul, |
| @@ -171,7 +174,10 @@ public: |
| Pand, |
| Pcmpeq, |
| Pcmpgt, |
| + Pextrw, |
| + Pinsrw, |
| Pop, |
| + Pshufd, |
| Push, |
| Psll, |
| Psra, |
| @@ -184,6 +190,7 @@ public: |
| Shld, |
| Shr, |
| Shrd, |
| + Shufps, |
| Sqrtss, |
| Store, |
| StoreQ, |
| @@ -424,7 +431,11 @@ public: |
| Ostream &Str = Func->getContext()->getStrEmit(); |
| assert(getSrcSize() == 3); |
| Str << "\t" << Opcode << "\t"; |
| + getDest()->emit(Func); |
|
Jim Stichnoth
2014/07/17 19:49:01
Hmm, do the existing div/idiv instructions still e
|
| + Str << ", "; |
| getSrc(1)->emit(Func); |
| + Str << ", "; |
| + getSrc(2)->emit(Func); |
| Str << "\n"; |
| } |
| virtual void dump(const Cfg *Func) const { |
| @@ -448,8 +459,54 @@ private: |
| static const char *Opcode; |
| }; |
| +// Instructions of the form x := y op z |
| +template <InstX8632::InstKindX8632 K> |
| +class InstX8632ThreeAddressop : public InstX8632 { |
| +public: |
| + static InstX8632ThreeAddressop *create(Cfg *Func, Variable *Dest, |
| + Operand *Source0, Operand *Source1) { |
| + return new (Func->allocate<InstX8632ThreeAddressop>()) |
| + InstX8632ThreeAddressop(Func, Dest, Source0, Source1); |
| + } |
| + virtual void emit(const Cfg *Func) const { |
| + Ostream &Str = Func->getContext()->getStrEmit(); |
| + assert(getSrcSize() == 2); |
| + Str << "\t" << Opcode << "\t"; |
| + getDest()->emit(Func); |
| + Str << ", "; |
| + getSrc(0)->emit(Func); |
| + Str << ", "; |
| + getSrc(1)->emit(Func); |
| + Str << "\n"; |
| + } |
| + virtual void dump(const Cfg *Func) const { |
| + Ostream &Str = Func->getContext()->getStrDump(); |
| + dumpDest(Func); |
| + Str << " = " << Opcode << "." << getDest()->getType() << " "; |
| + dumpSources(Func); |
| + } |
| + static bool classof(const Inst *Inst) { return isClassof(Inst, K); } |
| + |
| +private: |
| + InstX8632ThreeAddressop(Cfg *Func, Variable *Dest, Operand *Source0, |
| + Operand *Source1) |
| + : InstX8632(Func, K, 2, Dest) { |
| + addSource(Source0); |
| + addSource(Source1); |
| + } |
| + InstX8632ThreeAddressop(const InstX8632ThreeAddressop &) |
| + LLVM_DELETED_FUNCTION; |
| + InstX8632ThreeAddressop & |
| + operator=(const InstX8632ThreeAddressop &) LLVM_DELETED_FUNCTION; |
| + virtual ~InstX8632ThreeAddressop() {} |
| + static const char *Opcode; |
| +}; |
| + |
| typedef InstX8632Unaryop<InstX8632::Bsf> InstX8632Bsf; |
| typedef InstX8632Unaryop<InstX8632::Bsr> InstX8632Bsr; |
| +typedef InstX8632Unaryop<InstX8632::Lea> InstX8632Lea; |
| +typedef InstX8632Unaryop<InstX8632::Movd> InstX8632Movd; |
| +typedef InstX8632Unaryop<InstX8632::Movss> InstX8632Movss; |
| typedef InstX8632Unaryop<InstX8632::Sqrtss> InstX8632Sqrtss; |
| typedef InstX8632Binop<InstX8632::Add> InstX8632Add; |
| typedef InstX8632Binop<InstX8632::Addps> InstX8632Addps; |
| @@ -479,6 +536,10 @@ typedef InstX8632Binop<InstX8632::Pcmpeq> InstX8632Pcmpeq; |
| typedef InstX8632Binop<InstX8632::Pcmpgt> InstX8632Pcmpgt; |
| typedef InstX8632Ternop<InstX8632::Idiv> InstX8632Idiv; |
| typedef InstX8632Ternop<InstX8632::Div> InstX8632Div; |
| +typedef InstX8632Ternop<InstX8632::Pinsrw> InstX8632Pinsrw; |
| +typedef InstX8632Ternop<InstX8632::Shufps> InstX8632Shufps; |
| +typedef InstX8632ThreeAddressop<InstX8632::Pextrw> InstX8632Pextrw; |
| +typedef InstX8632ThreeAddressop<InstX8632::Pshufd> InstX8632Pshufd; |
| // Base class for a lockable x86-32 instruction (emits a locked prefix). |
| class InstX8632Lockable : public InstX8632 { |