| OLD | NEW |
| 1 //===- subzero/src/IceInstX86Base.h - Generic x86 instructions -*- C++ -*--===// | 1 //===- subzero/src/IceInstX86Base.h - Generic x86 instructions -*- 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 void emitIAS(const Cfg *Func) const override; | 398 void emitIAS(const Cfg *Func) const override; |
| 399 void dump(const Cfg *Func) const override; | 399 void dump(const Cfg *Func) const override; |
| 400 static bool classof(const Inst *Inst) { | 400 static bool classof(const Inst *Inst) { |
| 401 return InstX86Base<Machine>::isClassof(Inst, InstX86Base<Machine>::Jmp); | 401 return InstX86Base<Machine>::isClassof(Inst, InstX86Base<Machine>::Jmp); |
| 402 } | 402 } |
| 403 | 403 |
| 404 private: | 404 private: |
| 405 InstX86Jmp(Cfg *Func, Operand *Target); | 405 InstX86Jmp(Cfg *Func, Operand *Target); |
| 406 }; | 406 }; |
| 407 | 407 |
| 408 /// AdjustStack instruction - grows the stack (moves esp down) by the given | |
| 409 /// amount. If the amount is negative, it shrinks the stack (moves esp up). | |
| 410 /// It also updates the target lowering StackAdjustment during code emission. | |
| 411 template <class Machine> | |
| 412 class InstX86AdjustStack final : public InstX86Base<Machine> { | |
| 413 InstX86AdjustStack() = delete; | |
| 414 InstX86AdjustStack(const InstX86AdjustStack &) = delete; | |
| 415 InstX86AdjustStack &operator=(const InstX86AdjustStack &) = delete; | |
| 416 | |
| 417 public: | |
| 418 static InstX86AdjustStack *create(Cfg *Func, int32_t Amount, Variable *Esp) { | |
| 419 return new (Func->allocate<InstX86AdjustStack>()) | |
| 420 InstX86AdjustStack(Func, Amount, Esp); | |
| 421 } | |
| 422 void emit(const Cfg *Func) const override; | |
| 423 void emitIAS(const Cfg *Func) const override; | |
| 424 void dump(const Cfg *Func) const override; | |
| 425 static bool classof(const Inst *Inst) { | |
| 426 return InstX86Base<Machine>::isClassof(Inst, | |
| 427 InstX86Base<Machine>::Adjuststack); | |
| 428 } | |
| 429 | |
| 430 private: | |
| 431 InstX86AdjustStack(Cfg *Func, int32_t Amount, Variable *Esp); | |
| 432 const int32_t Amount; | |
| 433 }; | |
| 434 | |
| 435 /// Call instruction. Arguments should have already been pushed. | 408 /// Call instruction. Arguments should have already been pushed. |
| 436 template <class Machine> class InstX86Call final : public InstX86Base<Machine> { | 409 template <class Machine> class InstX86Call final : public InstX86Base<Machine> { |
| 437 InstX86Call() = delete; | 410 InstX86Call() = delete; |
| 438 InstX86Call(const InstX86Call &) = delete; | 411 InstX86Call(const InstX86Call &) = delete; |
| 439 InstX86Call &operator=(const InstX86Call &) = delete; | 412 InstX86Call &operator=(const InstX86Call &) = delete; |
| 440 | 413 |
| 441 public: | 414 public: |
| 442 static InstX86Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { | 415 static InstX86Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { |
| 443 return new (Func->allocate<InstX86Call>()) | 416 return new (Func->allocate<InstX86Call>()) |
| 444 InstX86Call(Func, Dest, CallTarget); | 417 InstX86Call(Func, Dest, CallTarget); |
| (...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2784 }; | 2757 }; |
| 2785 | 2758 |
| 2786 /// struct Insts is a template that can be used to instantiate all the X86 | 2759 /// struct Insts is a template that can be used to instantiate all the X86 |
| 2787 /// instructions for a target with a simple | 2760 /// instructions for a target with a simple |
| 2788 /// | 2761 /// |
| 2789 /// using Insts = ::Ice::X86Internal::Insts<TargeT>; | 2762 /// using Insts = ::Ice::X86Internal::Insts<TargeT>; |
| 2790 template <class Machine> struct Insts { | 2763 template <class Machine> struct Insts { |
| 2791 using FakeRMW = InstX86FakeRMW<Machine>; | 2764 using FakeRMW = InstX86FakeRMW<Machine>; |
| 2792 using Label = InstX86Label<Machine>; | 2765 using Label = InstX86Label<Machine>; |
| 2793 | 2766 |
| 2794 using AdjustStack = InstX86AdjustStack<Machine>; | |
| 2795 using Call = InstX86Call<Machine>; | 2767 using Call = InstX86Call<Machine>; |
| 2796 | 2768 |
| 2797 using Br = InstX86Br<Machine>; | 2769 using Br = InstX86Br<Machine>; |
| 2798 using Jmp = InstX86Jmp<Machine>; | 2770 using Jmp = InstX86Jmp<Machine>; |
| 2799 using Bswap = InstX86Bswap<Machine>; | 2771 using Bswap = InstX86Bswap<Machine>; |
| 2800 using Neg = InstX86Neg<Machine>; | 2772 using Neg = InstX86Neg<Machine>; |
| 2801 using Bsf = InstX86Bsf<Machine>; | 2773 using Bsf = InstX86Bsf<Machine>; |
| 2802 using Bsr = InstX86Bsr<Machine>; | 2774 using Bsr = InstX86Bsr<Machine>; |
| 2803 using Lea = InstX86Lea<Machine>; | 2775 using Lea = InstX86Lea<Machine>; |
| 2804 using Cbwdq = InstX86Cbwdq<Machine>; | 2776 using Cbwdq = InstX86Cbwdq<Machine>; |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3243 &InstX86Base<Machine>::Traits::Assembler::psrl}; \ | 3215 &InstX86Base<Machine>::Traits::Assembler::psrl}; \ |
| 3244 } \ | 3216 } \ |
| 3245 } | 3217 } |
| 3246 | 3218 |
| 3247 } // end of namespace X86Internal | 3219 } // end of namespace X86Internal |
| 3248 } // end of namespace Ice | 3220 } // end of namespace Ice |
| 3249 | 3221 |
| 3250 #include "IceInstX86BaseImpl.h" | 3222 #include "IceInstX86BaseImpl.h" |
| 3251 | 3223 |
| 3252 #endif // SUBZERO_SRC_ICEINSTX86BASE_H | 3224 #endif // SUBZERO_SRC_ICEINSTX86BASE_H |
| OLD | NEW |