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

Side by Side Diff: src/IceInstX8632.h

Issue 814353002: Subzero: Convert NULL->nullptr. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Revert crosstest whitespace changes Created 6 years 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/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('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/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===// 1 //===- subzero/src/IceInstX8632.h - Low-level 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 // This file declares the InstX8632 and OperandX8632 classes and 10 // This file declares the InstX8632 and OperandX8632 classes and
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 public: 61 public:
62 enum SegmentRegisters { 62 enum SegmentRegisters {
63 DefaultSegment = -1, 63 DefaultSegment = -1,
64 #define X(val, name, prefix) val, 64 #define X(val, name, prefix) val,
65 SEG_REGX8632_TABLE 65 SEG_REGX8632_TABLE
66 #undef X 66 #undef X
67 SegReg_NUM 67 SegReg_NUM
68 }; 68 };
69 static OperandX8632Mem *create(Cfg *Func, Type Ty, Variable *Base, 69 static OperandX8632Mem *create(Cfg *Func, Type Ty, Variable *Base,
70 Constant *Offset, Variable *Index = NULL, 70 Constant *Offset, Variable *Index = nullptr,
71 uint16_t Shift = 0, 71 uint16_t Shift = 0,
72 SegmentRegisters SegmentReg = DefaultSegment) { 72 SegmentRegisters SegmentReg = DefaultSegment) {
73 return new (Func->allocate<OperandX8632Mem>()) 73 return new (Func->allocate<OperandX8632Mem>())
74 OperandX8632Mem(Func, Ty, Base, Offset, Index, Shift, SegmentReg); 74 OperandX8632Mem(Func, Ty, Base, Offset, Index, Shift, SegmentReg);
75 } 75 }
76 Variable *getBase() const { return Base; } 76 Variable *getBase() const { return Base; }
77 Constant *getOffset() const { return Offset; } 77 Constant *getOffset() const { return Offset; }
78 Variable *getIndex() const { return Index; } 78 Variable *getIndex() const { return Index; }
79 uint16_t getShift() const { return Shift; } 79 uint16_t getShift() const { return Shift; }
80 SegmentRegisters getSegmentRegister() const { return SegmentReg; } 80 SegmentRegisters getSegmentRegister() const { return SegmentReg; }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 const static OperandKind SpillVariableKind = 158 const static OperandKind SpillVariableKind =
159 static_cast<OperandKind>(kVariable_Target); 159 static_cast<OperandKind>(kVariable_Target);
160 static bool classof(const Operand *Operand) { 160 static bool classof(const Operand *Operand) {
161 return Operand->getKind() == SpillVariableKind; 161 return Operand->getKind() == SpillVariableKind;
162 } 162 }
163 void setLinkedTo(Variable *Var) { LinkedTo = Var; } 163 void setLinkedTo(Variable *Var) { LinkedTo = Var; }
164 Variable *getLinkedTo() const { return LinkedTo; } 164 Variable *getLinkedTo() const { return LinkedTo; }
165 // Inherit dump() and emit() from Variable. 165 // Inherit dump() and emit() from Variable.
166 private: 166 private:
167 SpillVariable(Type Ty, SizeT Index) 167 SpillVariable(Type Ty, SizeT Index)
168 : Variable(SpillVariableKind, Ty, Index), LinkedTo(NULL) {} 168 : Variable(SpillVariableKind, Ty, Index), LinkedTo(nullptr) {}
169 Variable *LinkedTo; 169 Variable *LinkedTo;
170 }; 170 };
171 171
172 class InstX8632 : public InstTarget { 172 class InstX8632 : public InstTarget {
173 InstX8632(const InstX8632 &) = delete; 173 InstX8632(const InstX8632 &) = delete;
174 InstX8632 &operator=(const InstX8632 &) = delete; 174 InstX8632 &operator=(const InstX8632 &) = delete;
175 175
176 public: 176 public:
177 enum InstKindX8632 { 177 enum InstKindX8632 {
178 k__Start = Inst::Target, 178 k__Start = Inst::Target,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // Conditional and unconditional branch instruction. 337 // Conditional and unconditional branch instruction.
338 class InstX8632Br : public InstX8632 { 338 class InstX8632Br : public InstX8632 {
339 InstX8632Br(const InstX8632Br &) = delete; 339 InstX8632Br(const InstX8632Br &) = delete;
340 InstX8632Br &operator=(const InstX8632Br &) = delete; 340 InstX8632Br &operator=(const InstX8632Br &) = delete;
341 341
342 public: 342 public:
343 // Create a conditional branch to a node. 343 // Create a conditional branch to a node.
344 static InstX8632Br *create(Cfg *Func, CfgNode *TargetTrue, 344 static InstX8632Br *create(Cfg *Func, CfgNode *TargetTrue,
345 CfgNode *TargetFalse, CondX86::BrCond Condition) { 345 CfgNode *TargetFalse, CondX86::BrCond Condition) {
346 assert(Condition != CondX86::Br_None); 346 assert(Condition != CondX86::Br_None);
347 const InstX8632Label *NoLabel = NULL; 347 const InstX8632Label *NoLabel = nullptr;
348 return new (Func->allocate<InstX8632Br>()) 348 return new (Func->allocate<InstX8632Br>())
349 InstX8632Br(Func, TargetTrue, TargetFalse, NoLabel, Condition); 349 InstX8632Br(Func, TargetTrue, TargetFalse, NoLabel, Condition);
350 } 350 }
351 // Create an unconditional branch to a node. 351 // Create an unconditional branch to a node.
352 static InstX8632Br *create(Cfg *Func, CfgNode *Target) { 352 static InstX8632Br *create(Cfg *Func, CfgNode *Target) {
353 const CfgNode *NoCondTarget = NULL; 353 const CfgNode *NoCondTarget = nullptr;
354 const InstX8632Label *NoLabel = NULL; 354 const InstX8632Label *NoLabel = nullptr;
355 return new (Func->allocate<InstX8632Br>()) 355 return new (Func->allocate<InstX8632Br>())
356 InstX8632Br(Func, NoCondTarget, Target, NoLabel, CondX86::Br_None); 356 InstX8632Br(Func, NoCondTarget, Target, NoLabel, CondX86::Br_None);
357 } 357 }
358 // Create a non-terminator conditional branch to a node, with a 358 // Create a non-terminator conditional branch to a node, with a
359 // fallthrough to the next instruction in the current node. This is 359 // fallthrough to the next instruction in the current node. This is
360 // used for switch lowering. 360 // used for switch lowering.
361 static InstX8632Br *create(Cfg *Func, CfgNode *Target, 361 static InstX8632Br *create(Cfg *Func, CfgNode *Target,
362 CondX86::BrCond Condition) { 362 CondX86::BrCond Condition) {
363 assert(Condition != CondX86::Br_None); 363 assert(Condition != CondX86::Br_None);
364 const CfgNode *NoUncondTarget = NULL; 364 const CfgNode *NoUncondTarget = nullptr;
365 const InstX8632Label *NoLabel = NULL; 365 const InstX8632Label *NoLabel = nullptr;
366 return new (Func->allocate<InstX8632Br>()) 366 return new (Func->allocate<InstX8632Br>())
367 InstX8632Br(Func, Target, NoUncondTarget, NoLabel, Condition); 367 InstX8632Br(Func, Target, NoUncondTarget, NoLabel, Condition);
368 } 368 }
369 // Create a conditional intra-block branch (or unconditional, if 369 // Create a conditional intra-block branch (or unconditional, if
370 // Condition==Br_None) to a label in the current block. 370 // Condition==Br_None) to a label in the current block.
371 static InstX8632Br *create(Cfg *Func, InstX8632Label *Label, 371 static InstX8632Br *create(Cfg *Func, InstX8632Label *Label,
372 CondX86::BrCond Condition) { 372 CondX86::BrCond Condition) {
373 const CfgNode *NoCondTarget = NULL; 373 const CfgNode *NoCondTarget = nullptr;
374 const CfgNode *NoUncondTarget = NULL; 374 const CfgNode *NoUncondTarget = nullptr;
375 return new (Func->allocate<InstX8632Br>()) 375 return new (Func->allocate<InstX8632Br>())
376 InstX8632Br(Func, NoCondTarget, NoUncondTarget, Label, Condition); 376 InstX8632Br(Func, NoCondTarget, NoUncondTarget, Label, Condition);
377 } 377 }
378 const CfgNode *getTargetTrue() const { return TargetTrue; } 378 const CfgNode *getTargetTrue() const { return TargetTrue; }
379 const CfgNode *getTargetFalse() const { return TargetFalse; } 379 const CfgNode *getTargetFalse() const { return TargetFalse; }
380 bool optimizeBranch(const CfgNode *NextNode); 380 bool optimizeBranch(const CfgNode *NextNode);
381 uint32_t getEmitInstCount() const override { 381 uint32_t getEmitInstCount() const override {
382 uint32_t Sum = 0; 382 uint32_t Sum = 0;
383 if (Label) 383 if (Label)
384 ++Sum; 384 ++Sum;
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 1479
1480 // Ret instruction. Currently only supports the "ret" version that 1480 // Ret instruction. Currently only supports the "ret" version that
1481 // does not pop arguments. This instruction takes a Source operand 1481 // does not pop arguments. This instruction takes a Source operand
1482 // (for non-void returning functions) for liveness analysis, though 1482 // (for non-void returning functions) for liveness analysis, though
1483 // a FakeUse before the ret would do just as well. 1483 // a FakeUse before the ret would do just as well.
1484 class InstX8632Ret : public InstX8632 { 1484 class InstX8632Ret : public InstX8632 {
1485 InstX8632Ret(const InstX8632Ret &) = delete; 1485 InstX8632Ret(const InstX8632Ret &) = delete;
1486 InstX8632Ret &operator=(const InstX8632Ret &) = delete; 1486 InstX8632Ret &operator=(const InstX8632Ret &) = delete;
1487 1487
1488 public: 1488 public:
1489 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { 1489 static InstX8632Ret *create(Cfg *Func, Variable *Source = nullptr) {
1490 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); 1490 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source);
1491 } 1491 }
1492 void emit(const Cfg *Func) const override; 1492 void emit(const Cfg *Func) const override;
1493 void emitIAS(const Cfg *Func) const override; 1493 void emitIAS(const Cfg *Func) const override;
1494 void dump(const Cfg *Func) const override; 1494 void dump(const Cfg *Func) const override;
1495 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } 1495 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); }
1496 1496
1497 private: 1497 private:
1498 InstX8632Ret(Cfg *Func, Variable *Source); 1498 InstX8632Ret(Cfg *Func, Variable *Source);
1499 ~InstX8632Ret() override {} 1499 ~InstX8632Ret() override {}
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; 1590 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const;
1591 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; 1591 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const;
1592 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; 1592 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const;
1593 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; 1593 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const;
1594 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; 1594 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const;
1595 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; 1595 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const;
1596 1596
1597 } // end of namespace Ice 1597 } // end of namespace Ice
1598 1598
1599 #endif // SUBZERO_SRC_ICEINSTX8632_H 1599 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698