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

Side by Side Diff: src/IceInstX86Base.h

Issue 1506653002: Subzero: Add Non-SFI support for x86-32. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 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 unified diff | Download patch
« no previous file with comments | « src/IceInstX8664.cpp ('k') | src/IceInstX86BaseImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 Cmpps, 94 Cmpps,
95 Cmpxchg, 95 Cmpxchg,
96 Cmpxchg8b, 96 Cmpxchg8b,
97 Cvt, 97 Cvt,
98 Div, 98 Div,
99 Divps, 99 Divps,
100 Divss, 100 Divss,
101 FakeRMW, 101 FakeRMW,
102 Fld, 102 Fld,
103 Fstp, 103 Fstp,
104 GetIP,
104 Icmp, 105 Icmp,
105 Idiv, 106 Idiv,
106 Imul, 107 Imul,
107 ImulImm, 108 ImulImm,
108 Insertps, 109 Insertps,
109 Jmp, 110 Jmp,
110 Label, 111 Label,
111 Lea, 112 Lea,
112 Load, 113 Load,
113 Mfence, 114 Mfence,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 static bool classof(const Inst *Inst) { 259 static bool classof(const Inst *Inst) {
259 return InstX86Base::isClassof(Inst, InstX86Base::FakeRMW); 260 return InstX86Base::isClassof(Inst, InstX86Base::FakeRMW);
260 } 261 }
261 262
262 private: 263 private:
263 InstArithmetic::OpKind Op; 264 InstArithmetic::OpKind Op;
264 InstX86FakeRMW(Cfg *Func, Operand *Data, Operand *Addr, 265 InstX86FakeRMW(Cfg *Func, Operand *Data, Operand *Addr,
265 InstArithmetic::OpKind Op, Variable *Beacon); 266 InstArithmetic::OpKind Op, Variable *Beacon);
266 }; 267 };
267 268
269 class InstX86GetIP final : public InstX86Base {
270 InstX86GetIP() = delete;
271 InstX86GetIP(const InstX86GetIP &) = delete;
272 InstX86GetIP &operator=(const InstX86GetIP &) = delete;
273
274 public:
275 static InstX86GetIP *create(Cfg *Func, Variable *Dest) {
276 return new (Func->allocate<InstX86GetIP>()) InstX86GetIP(Func, Dest);
277 }
278 void emit(const Cfg *Func) const override;
279 void emitIAS(const Cfg *Func) const override;
280 void dump(const Cfg *Func) const override;
281 static bool classof(const Inst *Inst) {
282 return InstX86Base::isClassof(Inst, InstX86Base::GetIP);
283 }
284
285 private:
286 InstX86GetIP(Cfg *Func, Variable *Dest);
287 };
288
268 /// InstX86Label represents an intra-block label that is the target of an 289 /// InstX86Label represents an intra-block label that is the target of an
269 /// intra-block branch. The offset between the label and the branch must be 290 /// intra-block branch. The offset between the label and the branch must be
270 /// fit into one byte (considered "near"). These are used for lowering i1 291 /// fit into one byte (considered "near"). These are used for lowering i1
271 /// calculations, Select instructions, and 64-bit compares on a 32-bit 292 /// calculations, Select instructions, and 64-bit compares on a 32-bit
272 /// architecture, without basic block splitting. Basic block splitting is not 293 /// architecture, without basic block splitting. Basic block splitting is not
273 /// so desirable for several reasons, one of which is the impact on decisions 294 /// so desirable for several reasons, one of which is the impact on decisions
274 /// based on whether a variable's live range spans multiple basic blocks. 295 /// based on whether a variable's live range spans multiple basic blocks.
275 /// 296 ///
276 /// Intra-block control flow must be used with caution. Consider the sequence 297 /// Intra-block control flow must be used with caution. Consider the sequence
277 /// for "c = (a >= b ? x : y)". 298 /// for "c = (a >= b ? x : y)".
(...skipping 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 private: 2785 private:
2765 InstX86IacaEnd(Cfg *Func); 2786 InstX86IacaEnd(Cfg *Func);
2766 }; 2787 };
2767 }; // struct InstImpl 2788 }; // struct InstImpl
2768 2789
2769 /// struct Insts is a template that can be used to instantiate all the X86 2790 /// struct Insts is a template that can be used to instantiate all the X86
2770 /// instructions for a target with a simple 2791 /// instructions for a target with a simple
2771 /// 2792 ///
2772 /// using Insts = ::Ice::X86NAMESPACE::Insts<TraitsType>; 2793 /// using Insts = ::Ice::X86NAMESPACE::Insts<TraitsType>;
2773 template <typename TraitsType> struct Insts { 2794 template <typename TraitsType> struct Insts {
2795 using GetIP = typename InstImpl<TraitsType>::InstX86GetIP;
2774 using FakeRMW = typename InstImpl<TraitsType>::InstX86FakeRMW; 2796 using FakeRMW = typename InstImpl<TraitsType>::InstX86FakeRMW;
2775 using Label = typename InstImpl<TraitsType>::InstX86Label; 2797 using Label = typename InstImpl<TraitsType>::InstX86Label;
2776 2798
2777 using Call = typename InstImpl<TraitsType>::InstX86Call; 2799 using Call = typename InstImpl<TraitsType>::InstX86Call;
2778 2800
2779 using Br = typename InstImpl<TraitsType>::InstX86Br; 2801 using Br = typename InstImpl<TraitsType>::InstX86Br;
2780 using Jmp = typename InstImpl<TraitsType>::InstX86Jmp; 2802 using Jmp = typename InstImpl<TraitsType>::InstX86Jmp;
2781 using Bswap = typename InstImpl<TraitsType>::InstX86Bswap; 2803 using Bswap = typename InstImpl<TraitsType>::InstX86Bswap;
2782 using Neg = typename InstImpl<TraitsType>::InstX86Neg; 2804 using Neg = typename InstImpl<TraitsType>::InstX86Neg;
2783 using Bsf = typename InstImpl<TraitsType>::InstX86Bsf; 2805 using Bsf = typename InstImpl<TraitsType>::InstX86Bsf;
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
3475 &InstImpl<TraitsType>::Assembler::psrl}; \ 3497 &InstImpl<TraitsType>::Assembler::psrl}; \
3476 } \ 3498 } \
3477 } 3499 }
3478 3500
3479 } // end of namespace X86NAMESPACE 3501 } // end of namespace X86NAMESPACE
3480 } // end of namespace Ice 3502 } // end of namespace Ice
3481 3503
3482 #include "IceInstX86BaseImpl.h" 3504 #include "IceInstX86BaseImpl.h"
3483 3505
3484 #endif // SUBZERO_SRC_ICEINSTX86BASE_H 3506 #endif // SUBZERO_SRC_ICEINSTX86BASE_H
OLDNEW
« no previous file with comments | « src/IceInstX8664.cpp ('k') | src/IceInstX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698