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

Side by Side Diff: src/IceInstX8632.h

Issue 619983002: Subzero: Remove LLVM_DELETED_FUNCTION. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 2 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/IceInst.h ('k') | src/IceIntrinsics.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/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 29 matching lines...) Expand all
40 void dump(const Cfg *, Ostream &Str) const override { 40 void dump(const Cfg *, Ostream &Str) const override {
41 Str << "<OperandX8632>"; 41 Str << "<OperandX8632>";
42 } 42 }
43 43
44 protected: 44 protected:
45 OperandX8632(OperandKindX8632 Kind, Type Ty) 45 OperandX8632(OperandKindX8632 Kind, Type Ty)
46 : Operand(static_cast<OperandKind>(Kind), Ty) {} 46 : Operand(static_cast<OperandKind>(Kind), Ty) {}
47 ~OperandX8632() override {} 47 ~OperandX8632() override {}
48 48
49 private: 49 private:
50 OperandX8632(const OperandX8632 &) LLVM_DELETED_FUNCTION; 50 OperandX8632(const OperandX8632 &) = delete;
51 OperandX8632 &operator=(const OperandX8632 &) LLVM_DELETED_FUNCTION; 51 OperandX8632 &operator=(const OperandX8632 &) = delete;
52 }; 52 };
53 53
54 // OperandX8632Mem represents the m32 addressing mode, with optional 54 // OperandX8632Mem represents the m32 addressing mode, with optional
55 // base and index registers, a constant offset, and a fixed shift 55 // base and index registers, a constant offset, and a fixed shift
56 // value for the index register. 56 // value for the index register.
57 class OperandX8632Mem : public OperandX8632 { 57 class OperandX8632Mem : public OperandX8632 {
58 public: 58 public:
59 enum SegmentRegisters { 59 enum SegmentRegisters {
60 DefaultSegment = -1, 60 DefaultSegment = -1,
61 #define X(val, name) val, 61 #define X(val, name) val,
(...skipping 18 matching lines...) Expand all
80 using OperandX8632::dump; 80 using OperandX8632::dump;
81 void dump(const Cfg *Func, Ostream &Str) const override; 81 void dump(const Cfg *Func, Ostream &Str) const override;
82 82
83 static bool classof(const Operand *Operand) { 83 static bool classof(const Operand *Operand) {
84 return Operand->getKind() == static_cast<OperandKind>(kMem); 84 return Operand->getKind() == static_cast<OperandKind>(kMem);
85 } 85 }
86 86
87 private: 87 private:
88 OperandX8632Mem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset, 88 OperandX8632Mem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset,
89 Variable *Index, uint16_t Shift, SegmentRegisters SegmentReg); 89 Variable *Index, uint16_t Shift, SegmentRegisters SegmentReg);
90 OperandX8632Mem(const OperandX8632Mem &) LLVM_DELETED_FUNCTION; 90 OperandX8632Mem(const OperandX8632Mem &) = delete;
91 OperandX8632Mem &operator=(const OperandX8632Mem &) LLVM_DELETED_FUNCTION; 91 OperandX8632Mem &operator=(const OperandX8632Mem &) = delete;
92 ~OperandX8632Mem() override {} 92 ~OperandX8632Mem() override {}
93 Variable *Base; 93 Variable *Base;
94 Constant *Offset; 94 Constant *Offset;
95 Variable *Index; 95 Variable *Index;
96 uint16_t Shift; 96 uint16_t Shift;
97 SegmentRegisters SegmentReg : 16; 97 SegmentRegisters SegmentReg : 16;
98 }; 98 };
99 99
100 // VariableSplit is a way to treat an f64 memory location as a pair 100 // VariableSplit is a way to treat an f64 memory location as a pair
101 // of i32 locations (Low and High). This is needed for some cases 101 // of i32 locations (Low and High). This is needed for some cases
(...skipping 19 matching lines...) Expand all
121 } 121 }
122 122
123 private: 123 private:
124 VariableSplit(Cfg *Func, Variable *Var, Portion Part) 124 VariableSplit(Cfg *Func, Variable *Var, Portion Part)
125 : OperandX8632(kSplit, IceType_i32), Func(Func), Var(Var), Part(Part) { 125 : OperandX8632(kSplit, IceType_i32), Func(Func), Var(Var), Part(Part) {
126 assert(Var->getType() == IceType_f64); 126 assert(Var->getType() == IceType_f64);
127 Vars = Func->allocateArrayOf<Variable *>(1); 127 Vars = Func->allocateArrayOf<Variable *>(1);
128 Vars[0] = Var; 128 Vars[0] = Var;
129 NumVars = 1; 129 NumVars = 1;
130 } 130 }
131 VariableSplit(const VariableSplit &) LLVM_DELETED_FUNCTION; 131 VariableSplit(const VariableSplit &) = delete;
132 VariableSplit &operator=(const VariableSplit &) LLVM_DELETED_FUNCTION; 132 VariableSplit &operator=(const VariableSplit &) = delete;
133 ~VariableSplit() override { Func->deallocateArrayOf<Variable *>(Vars); } 133 ~VariableSplit() override { Func->deallocateArrayOf<Variable *>(Vars); }
134 Cfg *Func; // Held only for the destructor. 134 Cfg *Func; // Held only for the destructor.
135 Variable *Var; 135 Variable *Var;
136 Portion Part; 136 Portion Part;
137 }; 137 };
138 138
139 // SpillVariable decorates a Variable by linking it to another 139 // SpillVariable decorates a Variable by linking it to another
140 // Variable. When stack frame offsets are computed, the SpillVariable 140 // Variable. When stack frame offsets are computed, the SpillVariable
141 // is given a distinct stack slot only if its linked Variable has a 141 // is given a distinct stack slot only if its linked Variable has a
142 // register. If the linked Variable has a stack slot, then the 142 // register. If the linked Variable has a stack slot, then the
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 protected: 257 protected:
258 InstX8632(Cfg *Func, InstKindX8632 Kind, SizeT Maxsrcs, Variable *Dest) 258 InstX8632(Cfg *Func, InstKindX8632 Kind, SizeT Maxsrcs, Variable *Dest)
259 : InstTarget(Func, static_cast<InstKind>(Kind), Maxsrcs, Dest) {} 259 : InstTarget(Func, static_cast<InstKind>(Kind), Maxsrcs, Dest) {}
260 ~InstX8632() override {} 260 ~InstX8632() override {}
261 static bool isClassof(const Inst *Inst, InstKindX8632 MyKind) { 261 static bool isClassof(const Inst *Inst, InstKindX8632 MyKind) {
262 return Inst->getKind() == static_cast<InstKind>(MyKind); 262 return Inst->getKind() == static_cast<InstKind>(MyKind);
263 } 263 }
264 264
265 private: 265 private:
266 InstX8632(const InstX8632 &) LLVM_DELETED_FUNCTION; 266 InstX8632(const InstX8632 &) = delete;
267 InstX8632 &operator=(const InstX8632 &) LLVM_DELETED_FUNCTION; 267 InstX8632 &operator=(const InstX8632 &) = delete;
268 }; 268 };
269 269
270 // InstX8632Label represents an intra-block label that is the 270 // InstX8632Label represents an intra-block label that is the
271 // target of an intra-block branch. These are used for lowering i1 271 // target of an intra-block branch. These are used for lowering i1
272 // calculations, Select instructions, and 64-bit compares on a 32-bit 272 // calculations, Select instructions, and 64-bit compares on a 32-bit
273 // architecture, without basic block splitting. Basic block splitting 273 // architecture, without basic block splitting. Basic block splitting
274 // is not so desirable for several reasons, one of which is the impact 274 // is not so desirable for several reasons, one of which is the impact
275 // on decisions based on whether a variable's live range spans 275 // on decisions based on whether a variable's live range spans
276 // multiple basic blocks. 276 // multiple basic blocks.
277 // 277 //
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 static InstX8632Label *create(Cfg *Func, TargetX8632 *Target) { 309 static InstX8632Label *create(Cfg *Func, TargetX8632 *Target) {
310 return new (Func->allocate<InstX8632Label>()) InstX8632Label(Func, Target); 310 return new (Func->allocate<InstX8632Label>()) InstX8632Label(Func, Target);
311 } 311 }
312 uint32_t getEmitInstCount() const override { return 0; } 312 uint32_t getEmitInstCount() const override { return 0; }
313 IceString getName(const Cfg *Func) const; 313 IceString getName(const Cfg *Func) const;
314 void emit(const Cfg *Func) const override; 314 void emit(const Cfg *Func) const override;
315 void dump(const Cfg *Func) const override; 315 void dump(const Cfg *Func) const override;
316 316
317 private: 317 private:
318 InstX8632Label(Cfg *Func, TargetX8632 *Target); 318 InstX8632Label(Cfg *Func, TargetX8632 *Target);
319 InstX8632Label(const InstX8632Label &) LLVM_DELETED_FUNCTION; 319 InstX8632Label(const InstX8632Label &) = delete;
320 InstX8632Label &operator=(const InstX8632Label &) LLVM_DELETED_FUNCTION; 320 InstX8632Label &operator=(const InstX8632Label &) = delete;
321 ~InstX8632Label() override {} 321 ~InstX8632Label() override {}
322 SizeT Number; // used only for unique label string generation 322 SizeT Number; // used only for unique label string generation
323 }; 323 };
324 324
325 // Conditional and unconditional branch instruction. 325 // Conditional and unconditional branch instruction.
326 class InstX8632Br : public InstX8632 { 326 class InstX8632Br : public InstX8632 {
327 public: 327 public:
328 // Create a conditional branch to a node. 328 // Create a conditional branch to a node.
329 static InstX8632Br *create(Cfg *Func, CfgNode *TargetTrue, 329 static InstX8632Br *create(Cfg *Func, CfgNode *TargetTrue,
330 CfgNode *TargetFalse, CondX86::BrCond Condition) { 330 CfgNode *TargetFalse, CondX86::BrCond Condition) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 ++Sum; 371 ++Sum;
372 return Sum; 372 return Sum;
373 } 373 }
374 void emit(const Cfg *Func) const override; 374 void emit(const Cfg *Func) const override;
375 void dump(const Cfg *Func) const override; 375 void dump(const Cfg *Func) const override;
376 static bool classof(const Inst *Inst) { return isClassof(Inst, Br); } 376 static bool classof(const Inst *Inst) { return isClassof(Inst, Br); }
377 377
378 private: 378 private:
379 InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, 379 InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse,
380 const InstX8632Label *Label, CondX86::BrCond Condition); 380 const InstX8632Label *Label, CondX86::BrCond Condition);
381 InstX8632Br(const InstX8632Br &) LLVM_DELETED_FUNCTION; 381 InstX8632Br(const InstX8632Br &) = delete;
382 InstX8632Br &operator=(const InstX8632Br &) LLVM_DELETED_FUNCTION; 382 InstX8632Br &operator=(const InstX8632Br &) = delete;
383 ~InstX8632Br() override {} 383 ~InstX8632Br() override {}
384 CondX86::BrCond Condition; 384 CondX86::BrCond Condition;
385 const CfgNode *TargetTrue; 385 const CfgNode *TargetTrue;
386 const CfgNode *TargetFalse; 386 const CfgNode *TargetFalse;
387 const InstX8632Label *Label; // Intra-block branch target 387 const InstX8632Label *Label; // Intra-block branch target
388 }; 388 };
389 389
390 // AdjustStack instruction - subtracts esp by the given amount and 390 // AdjustStack instruction - subtracts esp by the given amount and
391 // updates the stack offset during code emission. 391 // updates the stack offset during code emission.
392 class InstX8632AdjustStack : public InstX8632 { 392 class InstX8632AdjustStack : public InstX8632 {
393 public: 393 public:
394 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) { 394 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) {
395 return new (Func->allocate<InstX8632AdjustStack>()) 395 return new (Func->allocate<InstX8632AdjustStack>())
396 InstX8632AdjustStack(Func, Amount, Esp); 396 InstX8632AdjustStack(Func, Amount, Esp);
397 } 397 }
398 void emit(const Cfg *Func) const override; 398 void emit(const Cfg *Func) const override;
399 void emitIAS(const Cfg *Func) const override; 399 void emitIAS(const Cfg *Func) const override;
400 void dump(const Cfg *Func) const override; 400 void dump(const Cfg *Func) const override;
401 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); } 401 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); }
402 402
403 private: 403 private:
404 InstX8632AdjustStack(Cfg *Func, SizeT Amount, Variable *Esp); 404 InstX8632AdjustStack(Cfg *Func, SizeT Amount, Variable *Esp);
405 InstX8632AdjustStack(const InstX8632AdjustStack &) LLVM_DELETED_FUNCTION; 405 InstX8632AdjustStack(const InstX8632AdjustStack &) = delete;
406 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) 406 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) = delete;
407 LLVM_DELETED_FUNCTION;
408 SizeT Amount; 407 SizeT Amount;
409 }; 408 };
410 409
411 // Call instruction. Arguments should have already been pushed. 410 // Call instruction. Arguments should have already been pushed.
412 class InstX8632Call : public InstX8632 { 411 class InstX8632Call : public InstX8632 {
413 public: 412 public:
414 static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { 413 static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) {
415 return new (Func->allocate<InstX8632Call>()) 414 return new (Func->allocate<InstX8632Call>())
416 InstX8632Call(Func, Dest, CallTarget); 415 InstX8632Call(Func, Dest, CallTarget);
417 } 416 }
418 Operand *getCallTarget() const { return getSrc(0); } 417 Operand *getCallTarget() const { return getSrc(0); }
419 void emit(const Cfg *Func) const override; 418 void emit(const Cfg *Func) const override;
420 void dump(const Cfg *Func) const override; 419 void dump(const Cfg *Func) const override;
421 static bool classof(const Inst *Inst) { return isClassof(Inst, Call); } 420 static bool classof(const Inst *Inst) { return isClassof(Inst, Call); }
422 421
423 private: 422 private:
424 InstX8632Call(Cfg *Func, Variable *Dest, Operand *CallTarget); 423 InstX8632Call(Cfg *Func, Variable *Dest, Operand *CallTarget);
425 InstX8632Call(const InstX8632Call &) LLVM_DELETED_FUNCTION; 424 InstX8632Call(const InstX8632Call &) = delete;
426 InstX8632Call &operator=(const InstX8632Call &) LLVM_DELETED_FUNCTION; 425 InstX8632Call &operator=(const InstX8632Call &) = delete;
427 ~InstX8632Call() override {} 426 ~InstX8632Call() override {}
428 }; 427 };
429 428
430 // Emit a one-operand (GPR) instruction. 429 // Emit a one-operand (GPR) instruction.
431 void emitIASOpTyGPR(const Cfg *Func, Type Ty, const Operand *Var, 430 void emitIASOpTyGPR(const Cfg *Func, Type Ty, const Operand *Var,
432 const x86::AssemblerX86::GPREmitterOneOp &Emitter); 431 const x86::AssemblerX86::GPREmitterOneOp &Emitter);
433 432
434 // Instructions of the form x := op(x). 433 // Instructions of the form x := op(x).
435 template <InstX8632::InstKindX8632 K> 434 template <InstX8632::InstKindX8632 K>
436 class InstX8632InplaceopGPR : public InstX8632 { 435 class InstX8632InplaceopGPR : public InstX8632 {
(...skipping 21 matching lines...) Expand all
458 Str << " = " << Opcode << "." << getDest()->getType() << " "; 457 Str << " = " << Opcode << "." << getDest()->getType() << " ";
459 dumpSources(Func); 458 dumpSources(Func);
460 } 459 }
461 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 460 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
462 461
463 private: 462 private:
464 InstX8632InplaceopGPR(Cfg *Func, Operand *SrcDest) 463 InstX8632InplaceopGPR(Cfg *Func, Operand *SrcDest)
465 : InstX8632(Func, K, 1, llvm::dyn_cast<Variable>(SrcDest)) { 464 : InstX8632(Func, K, 1, llvm::dyn_cast<Variable>(SrcDest)) {
466 addSource(SrcDest); 465 addSource(SrcDest);
467 } 466 }
468 InstX8632InplaceopGPR(const InstX8632InplaceopGPR &) LLVM_DELETED_FUNCTION; 467 InstX8632InplaceopGPR(const InstX8632InplaceopGPR &) = delete;
469 InstX8632InplaceopGPR & 468 InstX8632InplaceopGPR &operator=(const InstX8632InplaceopGPR &) = delete;
470 operator=(const InstX8632InplaceopGPR &) LLVM_DELETED_FUNCTION;
471 ~InstX8632InplaceopGPR() override {} 469 ~InstX8632InplaceopGPR() override {}
472 static const char *Opcode; 470 static const char *Opcode;
473 static const x86::AssemblerX86::GPREmitterOneOp Emitter; 471 static const x86::AssemblerX86::GPREmitterOneOp Emitter;
474 }; 472 };
475 473
476 // Emit a two-operand (GPR) instruction, where the dest operand is a 474 // Emit a two-operand (GPR) instruction, where the dest operand is a
477 // Variable that's guaranteed to be a register. 475 // Variable that's guaranteed to be a register.
478 void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, const Variable *Dst, 476 void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, const Variable *Dst,
479 const Operand *Src, 477 const Operand *Src,
480 const x86::AssemblerX86::GPREmitterRegOp &Emitter); 478 const x86::AssemblerX86::GPREmitterRegOp &Emitter);
(...skipping 28 matching lines...) Expand all
509 Str << " = " << Opcode << "." << getDest()->getType() << " "; 507 Str << " = " << Opcode << "." << getDest()->getType() << " ";
510 dumpSources(Func); 508 dumpSources(Func);
511 } 509 }
512 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 510 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
513 511
514 private: 512 private:
515 InstX8632UnaryopGPR(Cfg *Func, Variable *Dest, Operand *Src) 513 InstX8632UnaryopGPR(Cfg *Func, Variable *Dest, Operand *Src)
516 : InstX8632(Func, K, 1, Dest) { 514 : InstX8632(Func, K, 1, Dest) {
517 addSource(Src); 515 addSource(Src);
518 } 516 }
519 InstX8632UnaryopGPR(const InstX8632UnaryopGPR &) LLVM_DELETED_FUNCTION; 517 InstX8632UnaryopGPR(const InstX8632UnaryopGPR &) = delete;
520 InstX8632UnaryopGPR & 518 InstX8632UnaryopGPR &operator=(const InstX8632UnaryopGPR &) = delete;
521 operator=(const InstX8632UnaryopGPR &) LLVM_DELETED_FUNCTION;
522 ~InstX8632UnaryopGPR() override {} 519 ~InstX8632UnaryopGPR() override {}
523 static const char *Opcode; 520 static const char *Opcode;
524 static const x86::AssemblerX86::GPREmitterRegOp Emitter; 521 static const x86::AssemblerX86::GPREmitterRegOp Emitter;
525 }; 522 };
526 523
527 void emitIASVarOperandTyXMM(const Cfg *Func, Type Ty, const Variable *Var, 524 void emitIASVarOperandTyXMM(const Cfg *Func, Type Ty, const Variable *Var,
528 const Operand *Src, 525 const Operand *Src,
529 const x86::AssemblerX86::XmmEmitterTwoOps &Emitter); 526 const x86::AssemblerX86::XmmEmitterTwoOps &Emitter);
530 527
531 template <InstX8632::InstKindX8632 K> 528 template <InstX8632::InstKindX8632 K>
(...skipping 23 matching lines...) Expand all
555 Str << " = " << Opcode << "." << getDest()->getType() << " "; 552 Str << " = " << Opcode << "." << getDest()->getType() << " ";
556 dumpSources(Func); 553 dumpSources(Func);
557 } 554 }
558 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 555 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
559 556
560 private: 557 private:
561 InstX8632UnaryopXmm(Cfg *Func, Variable *Dest, Operand *Src) 558 InstX8632UnaryopXmm(Cfg *Func, Variable *Dest, Operand *Src)
562 : InstX8632(Func, K, 1, Dest) { 559 : InstX8632(Func, K, 1, Dest) {
563 addSource(Src); 560 addSource(Src);
564 } 561 }
565 InstX8632UnaryopXmm(const InstX8632UnaryopXmm &) LLVM_DELETED_FUNCTION; 562 InstX8632UnaryopXmm(const InstX8632UnaryopXmm &) = delete;
566 InstX8632UnaryopXmm & 563 InstX8632UnaryopXmm &operator=(const InstX8632UnaryopXmm &) = delete;
567 operator=(const InstX8632UnaryopXmm &) LLVM_DELETED_FUNCTION;
568 ~InstX8632UnaryopXmm() override {} 564 ~InstX8632UnaryopXmm() override {}
569 static const char *Opcode; 565 static const char *Opcode;
570 static const x86::AssemblerX86::XmmEmitterTwoOps Emitter; 566 static const x86::AssemblerX86::XmmEmitterTwoOps Emitter;
571 }; 567 };
572 568
573 // See the definition of emitTwoAddress() for a description of 569 // See the definition of emitTwoAddress() for a description of
574 // ShiftHack. 570 // ShiftHack.
575 void emitTwoAddress(const char *Opcode, const Inst *Inst, const Cfg *Func, 571 void emitTwoAddress(const char *Opcode, const Inst *Inst, const Cfg *Func,
576 bool ShiftHack = false); 572 bool ShiftHack = false);
577 573
(...skipping 15 matching lines...) Expand all
593 dumpSources(Func); 589 dumpSources(Func);
594 } 590 }
595 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 591 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
596 592
597 private: 593 private:
598 InstX8632Binop(Cfg *Func, Variable *Dest, Operand *Source) 594 InstX8632Binop(Cfg *Func, Variable *Dest, Operand *Source)
599 : InstX8632(Func, K, 2, Dest) { 595 : InstX8632(Func, K, 2, Dest) {
600 addSource(Dest); 596 addSource(Dest);
601 addSource(Source); 597 addSource(Source);
602 } 598 }
603 InstX8632Binop(const InstX8632Binop &) LLVM_DELETED_FUNCTION; 599 InstX8632Binop(const InstX8632Binop &) = delete;
604 InstX8632Binop &operator=(const InstX8632Binop &) LLVM_DELETED_FUNCTION; 600 InstX8632Binop &operator=(const InstX8632Binop &) = delete;
605 ~InstX8632Binop() override {} 601 ~InstX8632Binop() override {}
606 static const char *Opcode; 602 static const char *Opcode;
607 }; 603 };
608 604
609 template <InstX8632::InstKindX8632 K> 605 template <InstX8632::InstKindX8632 K>
610 class InstX8632BinopGPR : public InstX8632 { 606 class InstX8632BinopGPR : public InstX8632 {
611 public: 607 public:
612 // Create an ordinary binary-op instruction like add or sub. 608 // Create an ordinary binary-op instruction like add or sub.
613 static InstX8632BinopGPR *create(Cfg *Func, Variable *Dest, Operand *Source) { 609 static InstX8632BinopGPR *create(Cfg *Func, Variable *Dest, Operand *Source) {
614 return new (Func->allocate<InstX8632BinopGPR>()) 610 return new (Func->allocate<InstX8632BinopGPR>())
(...skipping 15 matching lines...) Expand all
630 dumpSources(Func); 626 dumpSources(Func);
631 } 627 }
632 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 628 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
633 629
634 private: 630 private:
635 InstX8632BinopGPR(Cfg *Func, Variable *Dest, Operand *Source) 631 InstX8632BinopGPR(Cfg *Func, Variable *Dest, Operand *Source)
636 : InstX8632(Func, K, 2, Dest) { 632 : InstX8632(Func, K, 2, Dest) {
637 addSource(Dest); 633 addSource(Dest);
638 addSource(Source); 634 addSource(Source);
639 } 635 }
640 InstX8632BinopGPR(const InstX8632BinopGPR &) LLVM_DELETED_FUNCTION; 636 InstX8632BinopGPR(const InstX8632BinopGPR &) = delete;
641 InstX8632BinopGPR &operator=(const InstX8632BinopGPR &) LLVM_DELETED_FUNCTION; 637 InstX8632BinopGPR &operator=(const InstX8632BinopGPR &) = delete;
642 ~InstX8632BinopGPR() override {} 638 ~InstX8632BinopGPR() override {}
643 static const char *Opcode; 639 static const char *Opcode;
644 static const x86::AssemblerX86::GPREmitterRegOp Emitter; 640 static const x86::AssemblerX86::GPREmitterRegOp Emitter;
645 }; 641 };
646 642
647 template <InstX8632::InstKindX8632 K, bool NeedsElementType> 643 template <InstX8632::InstKindX8632 K, bool NeedsElementType>
648 class InstX8632BinopXmm : public InstX8632 { 644 class InstX8632BinopXmm : public InstX8632 {
649 public: 645 public:
650 // Create an XMM binary-op instruction like addss or addps. 646 // Create an XMM binary-op instruction like addss or addps.
651 static InstX8632BinopXmm *create(Cfg *Func, Variable *Dest, Operand *Source) { 647 static InstX8632BinopXmm *create(Cfg *Func, Variable *Dest, Operand *Source) {
(...skipping 18 matching lines...) Expand all
670 dumpSources(Func); 666 dumpSources(Func);
671 } 667 }
672 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 668 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
673 669
674 private: 670 private:
675 InstX8632BinopXmm(Cfg *Func, Variable *Dest, Operand *Source) 671 InstX8632BinopXmm(Cfg *Func, Variable *Dest, Operand *Source)
676 : InstX8632(Func, K, 2, Dest) { 672 : InstX8632(Func, K, 2, Dest) {
677 addSource(Dest); 673 addSource(Dest);
678 addSource(Source); 674 addSource(Source);
679 } 675 }
680 InstX8632BinopXmm(const InstX8632BinopXmm &) LLVM_DELETED_FUNCTION; 676 InstX8632BinopXmm(const InstX8632BinopXmm &) = delete;
681 InstX8632BinopXmm &operator=(const InstX8632BinopXmm &) LLVM_DELETED_FUNCTION; 677 InstX8632BinopXmm &operator=(const InstX8632BinopXmm &) = delete;
682 ~InstX8632BinopXmm() override {} 678 ~InstX8632BinopXmm() override {}
683 static const char *Opcode; 679 static const char *Opcode;
684 static const x86::AssemblerX86::XmmEmitterTwoOps Emitter; 680 static const x86::AssemblerX86::XmmEmitterTwoOps Emitter;
685 }; 681 };
686 682
687 template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 { 683 template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 {
688 public: 684 public:
689 // Create a ternary-op instruction like div or idiv. 685 // Create a ternary-op instruction like div or idiv.
690 static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1, 686 static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1,
691 Operand *Source2) { 687 Operand *Source2) {
(...skipping 20 matching lines...) Expand all
712 } 708 }
713 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 709 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
714 710
715 private: 711 private:
716 InstX8632Ternop(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2) 712 InstX8632Ternop(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2)
717 : InstX8632(Func, K, 3, Dest) { 713 : InstX8632(Func, K, 3, Dest) {
718 addSource(Dest); 714 addSource(Dest);
719 addSource(Source1); 715 addSource(Source1);
720 addSource(Source2); 716 addSource(Source2);
721 } 717 }
722 InstX8632Ternop(const InstX8632Ternop &) LLVM_DELETED_FUNCTION; 718 InstX8632Ternop(const InstX8632Ternop &) = delete;
723 InstX8632Ternop &operator=(const InstX8632Ternop &) LLVM_DELETED_FUNCTION; 719 InstX8632Ternop &operator=(const InstX8632Ternop &) = delete;
724 ~InstX8632Ternop() override {} 720 ~InstX8632Ternop() override {}
725 static const char *Opcode; 721 static const char *Opcode;
726 }; 722 };
727 723
728 // Instructions of the form x := y op z 724 // Instructions of the form x := y op z
729 template <InstX8632::InstKindX8632 K> 725 template <InstX8632::InstKindX8632 K>
730 class InstX8632ThreeAddressop : public InstX8632 { 726 class InstX8632ThreeAddressop : public InstX8632 {
731 public: 727 public:
732 static InstX8632ThreeAddressop *create(Cfg *Func, Variable *Dest, 728 static InstX8632ThreeAddressop *create(Cfg *Func, Variable *Dest,
733 Operand *Source0, Operand *Source1) { 729 Operand *Source0, Operand *Source1) {
(...skipping 19 matching lines...) Expand all
753 } 749 }
754 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 750 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
755 751
756 private: 752 private:
757 InstX8632ThreeAddressop(Cfg *Func, Variable *Dest, Operand *Source0, 753 InstX8632ThreeAddressop(Cfg *Func, Variable *Dest, Operand *Source0,
758 Operand *Source1) 754 Operand *Source1)
759 : InstX8632(Func, K, 2, Dest) { 755 : InstX8632(Func, K, 2, Dest) {
760 addSource(Source0); 756 addSource(Source0);
761 addSource(Source1); 757 addSource(Source1);
762 } 758 }
763 InstX8632ThreeAddressop(const InstX8632ThreeAddressop &) 759 InstX8632ThreeAddressop(const InstX8632ThreeAddressop &) = delete;
764 LLVM_DELETED_FUNCTION; 760 InstX8632ThreeAddressop &operator=(const InstX8632ThreeAddressop &) = delete;
765 InstX8632ThreeAddressop &
766 operator=(const InstX8632ThreeAddressop &) LLVM_DELETED_FUNCTION;
767 ~InstX8632ThreeAddressop() override {} 761 ~InstX8632ThreeAddressop() override {}
768 static const char *Opcode; 762 static const char *Opcode;
769 }; 763 };
770 764
771 bool checkForRedundantAssign(const Variable *Dest, const Operand *Source); 765 bool checkForRedundantAssign(const Variable *Dest, const Operand *Source);
772 766
773 // Base class for assignment instructions 767 // Base class for assignment instructions
774 template <InstX8632::InstKindX8632 K> 768 template <InstX8632::InstKindX8632 K>
775 class InstX8632Movlike : public InstX8632 { 769 class InstX8632Movlike : public InstX8632 {
776 public: 770 public:
(...skipping 13 matching lines...) Expand all
790 Str << ", "; 784 Str << ", ";
791 dumpSources(Func); 785 dumpSources(Func);
792 } 786 }
793 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 787 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
794 788
795 private: 789 private:
796 InstX8632Movlike(Cfg *Func, Variable *Dest, Operand *Source) 790 InstX8632Movlike(Cfg *Func, Variable *Dest, Operand *Source)
797 : InstX8632(Func, K, 1, Dest) { 791 : InstX8632(Func, K, 1, Dest) {
798 addSource(Source); 792 addSource(Source);
799 } 793 }
800 InstX8632Movlike(const InstX8632Movlike &) LLVM_DELETED_FUNCTION; 794 InstX8632Movlike(const InstX8632Movlike &) = delete;
801 InstX8632Movlike &operator=(const InstX8632Movlike &) LLVM_DELETED_FUNCTION; 795 InstX8632Movlike &operator=(const InstX8632Movlike &) = delete;
802 ~InstX8632Movlike() override {} 796 ~InstX8632Movlike() override {}
803 797
804 static const char *Opcode; 798 static const char *Opcode;
805 }; 799 };
806 800
807 typedef InstX8632InplaceopGPR<InstX8632::Bswap> InstX8632Bswap; 801 typedef InstX8632InplaceopGPR<InstX8632::Bswap> InstX8632Bswap;
808 typedef InstX8632InplaceopGPR<InstX8632::Neg> InstX8632Neg; 802 typedef InstX8632InplaceopGPR<InstX8632::Neg> InstX8632Neg;
809 typedef InstX8632UnaryopGPR<InstX8632::Bsf> InstX8632Bsf; 803 typedef InstX8632UnaryopGPR<InstX8632::Bsf> InstX8632Bsf;
810 typedef InstX8632UnaryopGPR<InstX8632::Bsr> InstX8632Bsr; 804 typedef InstX8632UnaryopGPR<InstX8632::Bsr> InstX8632Bsr;
811 typedef InstX8632UnaryopGPR<InstX8632::Lea> InstX8632Lea; 805 typedef InstX8632UnaryopGPR<InstX8632::Lea> InstX8632Lea;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 InstX8632Lockable(Cfg *Func, InstKindX8632 Kind, SizeT Maxsrcs, 871 InstX8632Lockable(Cfg *Func, InstKindX8632 Kind, SizeT Maxsrcs,
878 Variable *Dest, bool Locked) 872 Variable *Dest, bool Locked)
879 : InstX8632(Func, Kind, Maxsrcs, Dest), Locked(Locked) { 873 : InstX8632(Func, Kind, Maxsrcs, Dest), Locked(Locked) {
880 // Assume that such instructions are used for Atomics and be careful 874 // Assume that such instructions are used for Atomics and be careful
881 // with optimizations. 875 // with optimizations.
882 HasSideEffects = Locked; 876 HasSideEffects = Locked;
883 } 877 }
884 ~InstX8632Lockable() override {} 878 ~InstX8632Lockable() override {}
885 879
886 private: 880 private:
887 InstX8632Lockable(const InstX8632Lockable &) LLVM_DELETED_FUNCTION; 881 InstX8632Lockable(const InstX8632Lockable &) = delete;
888 InstX8632Lockable &operator=(const InstX8632Lockable &) LLVM_DELETED_FUNCTION; 882 InstX8632Lockable &operator=(const InstX8632Lockable &) = delete;
889 }; 883 };
890 884
891 // Mul instruction - unsigned multiply. 885 // Mul instruction - unsigned multiply.
892 class InstX8632Mul : public InstX8632 { 886 class InstX8632Mul : public InstX8632 {
893 public: 887 public:
894 static InstX8632Mul *create(Cfg *Func, Variable *Dest, Variable *Source1, 888 static InstX8632Mul *create(Cfg *Func, Variable *Dest, Variable *Source1,
895 Operand *Source2) { 889 Operand *Source2) {
896 return new (Func->allocate<InstX8632Mul>()) 890 return new (Func->allocate<InstX8632Mul>())
897 InstX8632Mul(Func, Dest, Source1, Source2); 891 InstX8632Mul(Func, Dest, Source1, Source2);
898 } 892 }
899 void emit(const Cfg *Func) const override; 893 void emit(const Cfg *Func) const override;
900 void emitIAS(const Cfg *Func) const override; 894 void emitIAS(const Cfg *Func) const override;
901 void dump(const Cfg *Func) const override; 895 void dump(const Cfg *Func) const override;
902 static bool classof(const Inst *Inst) { return isClassof(Inst, Mul); } 896 static bool classof(const Inst *Inst) { return isClassof(Inst, Mul); }
903 897
904 private: 898 private:
905 InstX8632Mul(Cfg *Func, Variable *Dest, Variable *Source1, Operand *Source2); 899 InstX8632Mul(Cfg *Func, Variable *Dest, Variable *Source1, Operand *Source2);
906 InstX8632Mul(const InstX8632Mul &) LLVM_DELETED_FUNCTION; 900 InstX8632Mul(const InstX8632Mul &) = delete;
907 InstX8632Mul &operator=(const InstX8632Mul &) LLVM_DELETED_FUNCTION; 901 InstX8632Mul &operator=(const InstX8632Mul &) = delete;
908 ~InstX8632Mul() override {} 902 ~InstX8632Mul() override {}
909 }; 903 };
910 904
911 // Shld instruction - shift across a pair of operands. TODO: Verify 905 // Shld instruction - shift across a pair of operands. TODO: Verify
912 // that the validator accepts the shld instruction. 906 // that the validator accepts the shld instruction.
913 class InstX8632Shld : public InstX8632 { 907 class InstX8632Shld : public InstX8632 {
914 public: 908 public:
915 static InstX8632Shld *create(Cfg *Func, Variable *Dest, Variable *Source1, 909 static InstX8632Shld *create(Cfg *Func, Variable *Dest, Variable *Source1,
916 Variable *Source2) { 910 Variable *Source2) {
917 return new (Func->allocate<InstX8632Shld>()) 911 return new (Func->allocate<InstX8632Shld>())
918 InstX8632Shld(Func, Dest, Source1, Source2); 912 InstX8632Shld(Func, Dest, Source1, Source2);
919 } 913 }
920 void emit(const Cfg *Func) const override; 914 void emit(const Cfg *Func) const override;
921 void dump(const Cfg *Func) const override; 915 void dump(const Cfg *Func) const override;
922 static bool classof(const Inst *Inst) { return isClassof(Inst, Shld); } 916 static bool classof(const Inst *Inst) { return isClassof(Inst, Shld); }
923 917
924 private: 918 private:
925 InstX8632Shld(Cfg *Func, Variable *Dest, Variable *Source1, 919 InstX8632Shld(Cfg *Func, Variable *Dest, Variable *Source1,
926 Variable *Source2); 920 Variable *Source2);
927 InstX8632Shld(const InstX8632Shld &) LLVM_DELETED_FUNCTION; 921 InstX8632Shld(const InstX8632Shld &) = delete;
928 InstX8632Shld &operator=(const InstX8632Shld &) LLVM_DELETED_FUNCTION; 922 InstX8632Shld &operator=(const InstX8632Shld &) = delete;
929 ~InstX8632Shld() override {} 923 ~InstX8632Shld() override {}
930 }; 924 };
931 925
932 // Shrd instruction - shift across a pair of operands. TODO: Verify 926 // Shrd instruction - shift across a pair of operands. TODO: Verify
933 // that the validator accepts the shrd instruction. 927 // that the validator accepts the shrd instruction.
934 class InstX8632Shrd : public InstX8632 { 928 class InstX8632Shrd : public InstX8632 {
935 public: 929 public:
936 static InstX8632Shrd *create(Cfg *Func, Variable *Dest, Variable *Source1, 930 static InstX8632Shrd *create(Cfg *Func, Variable *Dest, Variable *Source1,
937 Variable *Source2) { 931 Variable *Source2) {
938 return new (Func->allocate<InstX8632Shrd>()) 932 return new (Func->allocate<InstX8632Shrd>())
939 InstX8632Shrd(Func, Dest, Source1, Source2); 933 InstX8632Shrd(Func, Dest, Source1, Source2);
940 } 934 }
941 void emit(const Cfg *Func) const override; 935 void emit(const Cfg *Func) const override;
942 void dump(const Cfg *Func) const override; 936 void dump(const Cfg *Func) const override;
943 static bool classof(const Inst *Inst) { return isClassof(Inst, Shrd); } 937 static bool classof(const Inst *Inst) { return isClassof(Inst, Shrd); }
944 938
945 private: 939 private:
946 InstX8632Shrd(Cfg *Func, Variable *Dest, Variable *Source1, 940 InstX8632Shrd(Cfg *Func, Variable *Dest, Variable *Source1,
947 Variable *Source2); 941 Variable *Source2);
948 InstX8632Shrd(const InstX8632Shrd &) LLVM_DELETED_FUNCTION; 942 InstX8632Shrd(const InstX8632Shrd &) = delete;
949 InstX8632Shrd &operator=(const InstX8632Shrd &) LLVM_DELETED_FUNCTION; 943 InstX8632Shrd &operator=(const InstX8632Shrd &) = delete;
950 ~InstX8632Shrd() override {} 944 ~InstX8632Shrd() override {}
951 }; 945 };
952 946
953 // Conditional move instruction. 947 // Conditional move instruction.
954 class InstX8632Cmov : public InstX8632 { 948 class InstX8632Cmov : public InstX8632 {
955 public: 949 public:
956 static InstX8632Cmov *create(Cfg *Func, Variable *Dest, Operand *Source, 950 static InstX8632Cmov *create(Cfg *Func, Variable *Dest, Operand *Source,
957 CondX86::BrCond Cond) { 951 CondX86::BrCond Cond) {
958 return new (Func->allocate<InstX8632Cmov>()) 952 return new (Func->allocate<InstX8632Cmov>())
959 InstX8632Cmov(Func, Dest, Source, Cond); 953 InstX8632Cmov(Func, Dest, Source, Cond);
960 } 954 }
961 void emit(const Cfg *Func) const override; 955 void emit(const Cfg *Func) const override;
962 void emitIAS(const Cfg *Func) const override; 956 void emitIAS(const Cfg *Func) const override;
963 void dump(const Cfg *Func) const override; 957 void dump(const Cfg *Func) const override;
964 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmov); } 958 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmov); }
965 959
966 private: 960 private:
967 InstX8632Cmov(Cfg *Func, Variable *Dest, Operand *Source, 961 InstX8632Cmov(Cfg *Func, Variable *Dest, Operand *Source,
968 CondX86::BrCond Cond); 962 CondX86::BrCond Cond);
969 InstX8632Cmov(const InstX8632Cmov &) LLVM_DELETED_FUNCTION; 963 InstX8632Cmov(const InstX8632Cmov &) = delete;
970 InstX8632Cmov &operator=(const InstX8632Cmov &) LLVM_DELETED_FUNCTION; 964 InstX8632Cmov &operator=(const InstX8632Cmov &) = delete;
971 ~InstX8632Cmov() override {} 965 ~InstX8632Cmov() override {}
972 966
973 CondX86::BrCond Condition; 967 CondX86::BrCond Condition;
974 }; 968 };
975 969
976 // Cmpps instruction - compare packed singled-precision floating point 970 // Cmpps instruction - compare packed singled-precision floating point
977 // values 971 // values
978 class InstX8632Cmpps : public InstX8632 { 972 class InstX8632Cmpps : public InstX8632 {
979 public: 973 public:
980 static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source, 974 static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source,
981 CondX86::CmppsCond Condition) { 975 CondX86::CmppsCond Condition) {
982 return new (Func->allocate<InstX8632Cmpps>()) 976 return new (Func->allocate<InstX8632Cmpps>())
983 InstX8632Cmpps(Func, Dest, Source, Condition); 977 InstX8632Cmpps(Func, Dest, Source, Condition);
984 } 978 }
985 void emit(const Cfg *Func) const override; 979 void emit(const Cfg *Func) const override;
986 void emitIAS(const Cfg *Func) const override; 980 void emitIAS(const Cfg *Func) const override;
987 void dump(const Cfg *Func) const override; 981 void dump(const Cfg *Func) const override;
988 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpps); } 982 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpps); }
989 983
990 private: 984 private:
991 InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source, 985 InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source,
992 CondX86::CmppsCond Cond); 986 CondX86::CmppsCond Cond);
993 InstX8632Cmpps(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; 987 InstX8632Cmpps(const InstX8632Cmpps &) = delete;
994 InstX8632Cmpps &operator=(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; 988 InstX8632Cmpps &operator=(const InstX8632Cmpps &) = delete;
995 ~InstX8632Cmpps() override {} 989 ~InstX8632Cmpps() override {}
996 990
997 CondX86::CmppsCond Condition; 991 CondX86::CmppsCond Condition;
998 }; 992 };
999 993
1000 // Cmpxchg instruction - cmpxchg <dest>, <desired> will compare if <dest> 994 // Cmpxchg instruction - cmpxchg <dest>, <desired> will compare if <dest>
1001 // equals eax. If so, the ZF is set and <desired> is stored in <dest>. 995 // equals eax. If so, the ZF is set and <desired> is stored in <dest>.
1002 // If not, ZF is cleared and <dest> is copied to eax (or subregister). 996 // If not, ZF is cleared and <dest> is copied to eax (or subregister).
1003 // <dest> can be a register or memory, while <desired> must be a register. 997 // <dest> can be a register or memory, while <desired> must be a register.
1004 // It is the user's responsiblity to mark eax with a FakeDef. 998 // It is the user's responsiblity to mark eax with a FakeDef.
1005 class InstX8632Cmpxchg : public InstX8632Lockable { 999 class InstX8632Cmpxchg : public InstX8632Lockable {
1006 public: 1000 public:
1007 static InstX8632Cmpxchg *create(Cfg *Func, Operand *DestOrAddr, Variable *Eax, 1001 static InstX8632Cmpxchg *create(Cfg *Func, Operand *DestOrAddr, Variable *Eax,
1008 Variable *Desired, bool Locked) { 1002 Variable *Desired, bool Locked) {
1009 return new (Func->allocate<InstX8632Cmpxchg>()) 1003 return new (Func->allocate<InstX8632Cmpxchg>())
1010 InstX8632Cmpxchg(Func, DestOrAddr, Eax, Desired, Locked); 1004 InstX8632Cmpxchg(Func, DestOrAddr, Eax, Desired, Locked);
1011 } 1005 }
1012 void emit(const Cfg *Func) const override; 1006 void emit(const Cfg *Func) const override;
1013 void emitIAS(const Cfg *Func) const override; 1007 void emitIAS(const Cfg *Func) const override;
1014 void dump(const Cfg *Func) const override; 1008 void dump(const Cfg *Func) const override;
1015 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpxchg); } 1009 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpxchg); }
1016 1010
1017 private: 1011 private:
1018 InstX8632Cmpxchg(Cfg *Func, Operand *DestOrAddr, Variable *Eax, 1012 InstX8632Cmpxchg(Cfg *Func, Operand *DestOrAddr, Variable *Eax,
1019 Variable *Desired, bool Locked); 1013 Variable *Desired, bool Locked);
1020 InstX8632Cmpxchg(const InstX8632Cmpxchg &) LLVM_DELETED_FUNCTION; 1014 InstX8632Cmpxchg(const InstX8632Cmpxchg &) = delete;
1021 InstX8632Cmpxchg &operator=(const InstX8632Cmpxchg &) LLVM_DELETED_FUNCTION; 1015 InstX8632Cmpxchg &operator=(const InstX8632Cmpxchg &) = delete;
1022 ~InstX8632Cmpxchg() override {} 1016 ~InstX8632Cmpxchg() override {}
1023 }; 1017 };
1024 1018
1025 // Cmpxchg8b instruction - cmpxchg8b <m64> will compare if <m64> 1019 // Cmpxchg8b instruction - cmpxchg8b <m64> will compare if <m64>
1026 // equals edx:eax. If so, the ZF is set and ecx:ebx is stored in <m64>. 1020 // equals edx:eax. If so, the ZF is set and ecx:ebx is stored in <m64>.
1027 // If not, ZF is cleared and <m64> is copied to edx:eax. 1021 // If not, ZF is cleared and <m64> is copied to edx:eax.
1028 // The caller is responsible for inserting FakeDefs to mark edx 1022 // The caller is responsible for inserting FakeDefs to mark edx
1029 // and eax as modified. 1023 // and eax as modified.
1030 // <m64> must be a memory operand. 1024 // <m64> must be a memory operand.
1031 class InstX8632Cmpxchg8b : public InstX8632Lockable { 1025 class InstX8632Cmpxchg8b : public InstX8632Lockable {
1032 public: 1026 public:
1033 static InstX8632Cmpxchg8b *create(Cfg *Func, OperandX8632Mem *Dest, 1027 static InstX8632Cmpxchg8b *create(Cfg *Func, OperandX8632Mem *Dest,
1034 Variable *Edx, Variable *Eax, Variable *Ecx, 1028 Variable *Edx, Variable *Eax, Variable *Ecx,
1035 Variable *Ebx, bool Locked) { 1029 Variable *Ebx, bool Locked) {
1036 return new (Func->allocate<InstX8632Cmpxchg8b>()) 1030 return new (Func->allocate<InstX8632Cmpxchg8b>())
1037 InstX8632Cmpxchg8b(Func, Dest, Edx, Eax, Ecx, Ebx, Locked); 1031 InstX8632Cmpxchg8b(Func, Dest, Edx, Eax, Ecx, Ebx, Locked);
1038 } 1032 }
1039 void emit(const Cfg *Func) const override; 1033 void emit(const Cfg *Func) const override;
1040 void emitIAS(const Cfg *Func) const override; 1034 void emitIAS(const Cfg *Func) const override;
1041 void dump(const Cfg *Func) const override; 1035 void dump(const Cfg *Func) const override;
1042 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpxchg8b); } 1036 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpxchg8b); }
1043 1037
1044 private: 1038 private:
1045 InstX8632Cmpxchg8b(Cfg *Func, OperandX8632Mem *Dest, Variable *Edx, 1039 InstX8632Cmpxchg8b(Cfg *Func, OperandX8632Mem *Dest, Variable *Edx,
1046 Variable *Eax, Variable *Ecx, Variable *Ebx, bool Locked); 1040 Variable *Eax, Variable *Ecx, Variable *Ebx, bool Locked);
1047 InstX8632Cmpxchg8b(const InstX8632Cmpxchg8b &) LLVM_DELETED_FUNCTION; 1041 InstX8632Cmpxchg8b(const InstX8632Cmpxchg8b &) = delete;
1048 InstX8632Cmpxchg8b & 1042 InstX8632Cmpxchg8b &operator=(const InstX8632Cmpxchg8b &) = delete;
1049 operator=(const InstX8632Cmpxchg8b &) LLVM_DELETED_FUNCTION;
1050 ~InstX8632Cmpxchg8b() override {} 1043 ~InstX8632Cmpxchg8b() override {}
1051 }; 1044 };
1052 1045
1053 // Cvt instruction - wrapper for cvtsX2sY where X and Y are in {s,d,i} 1046 // Cvt instruction - wrapper for cvtsX2sY where X and Y are in {s,d,i}
1054 // as appropriate. s=float, d=double, i=int. X and Y are determined 1047 // as appropriate. s=float, d=double, i=int. X and Y are determined
1055 // from dest/src types. Sign and zero extension on the integer 1048 // from dest/src types. Sign and zero extension on the integer
1056 // operand needs to be done separately. 1049 // operand needs to be done separately.
1057 class InstX8632Cvt : public InstX8632 { 1050 class InstX8632Cvt : public InstX8632 {
1058 public: 1051 public:
1059 static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source, 1052 static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source,
1060 bool Trunc) { 1053 bool Trunc) {
1061 return new (Func->allocate<InstX8632Cvt>()) 1054 return new (Func->allocate<InstX8632Cvt>())
1062 InstX8632Cvt(Func, Dest, Source, Trunc); 1055 InstX8632Cvt(Func, Dest, Source, Trunc);
1063 } 1056 }
1064 void emit(const Cfg *Func) const override; 1057 void emit(const Cfg *Func) const override;
1065 void dump(const Cfg *Func) const override; 1058 void dump(const Cfg *Func) const override;
1066 static bool classof(const Inst *Inst) { return isClassof(Inst, Cvt); } 1059 static bool classof(const Inst *Inst) { return isClassof(Inst, Cvt); }
1067 1060
1068 private: 1061 private:
1069 bool Trunc; 1062 bool Trunc;
1070 InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source, bool Trunc); 1063 InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source, bool Trunc);
1071 InstX8632Cvt(const InstX8632Cvt &) LLVM_DELETED_FUNCTION; 1064 InstX8632Cvt(const InstX8632Cvt &) = delete;
1072 InstX8632Cvt &operator=(const InstX8632Cvt &) LLVM_DELETED_FUNCTION; 1065 InstX8632Cvt &operator=(const InstX8632Cvt &) = delete;
1073 ~InstX8632Cvt() override {} 1066 ~InstX8632Cvt() override {}
1074 }; 1067 };
1075 1068
1076 // cmp - Integer compare instruction. 1069 // cmp - Integer compare instruction.
1077 class InstX8632Icmp : public InstX8632 { 1070 class InstX8632Icmp : public InstX8632 {
1078 public: 1071 public:
1079 static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) { 1072 static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) {
1080 return new (Func->allocate<InstX8632Icmp>()) 1073 return new (Func->allocate<InstX8632Icmp>())
1081 InstX8632Icmp(Func, Src1, Src2); 1074 InstX8632Icmp(Func, Src1, Src2);
1082 } 1075 }
1083 void emit(const Cfg *Func) const override; 1076 void emit(const Cfg *Func) const override;
1084 void dump(const Cfg *Func) const override; 1077 void dump(const Cfg *Func) const override;
1085 static bool classof(const Inst *Inst) { return isClassof(Inst, Icmp); } 1078 static bool classof(const Inst *Inst) { return isClassof(Inst, Icmp); }
1086 1079
1087 private: 1080 private:
1088 InstX8632Icmp(Cfg *Func, Operand *Src1, Operand *Src2); 1081 InstX8632Icmp(Cfg *Func, Operand *Src1, Operand *Src2);
1089 InstX8632Icmp(const InstX8632Icmp &) LLVM_DELETED_FUNCTION; 1082 InstX8632Icmp(const InstX8632Icmp &) = delete;
1090 InstX8632Icmp &operator=(const InstX8632Icmp &) LLVM_DELETED_FUNCTION; 1083 InstX8632Icmp &operator=(const InstX8632Icmp &) = delete;
1091 ~InstX8632Icmp() override {} 1084 ~InstX8632Icmp() override {}
1092 }; 1085 };
1093 1086
1094 // ucomiss/ucomisd - floating-point compare instruction. 1087 // ucomiss/ucomisd - floating-point compare instruction.
1095 class InstX8632Ucomiss : public InstX8632 { 1088 class InstX8632Ucomiss : public InstX8632 {
1096 public: 1089 public:
1097 static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) { 1090 static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) {
1098 return new (Func->allocate<InstX8632Ucomiss>()) 1091 return new (Func->allocate<InstX8632Ucomiss>())
1099 InstX8632Ucomiss(Func, Src1, Src2); 1092 InstX8632Ucomiss(Func, Src1, Src2);
1100 } 1093 }
1101 void emit(const Cfg *Func) const override; 1094 void emit(const Cfg *Func) const override;
1102 void emitIAS(const Cfg *Func) const override; 1095 void emitIAS(const Cfg *Func) const override;
1103 void dump(const Cfg *Func) const override; 1096 void dump(const Cfg *Func) const override;
1104 static bool classof(const Inst *Inst) { return isClassof(Inst, Ucomiss); } 1097 static bool classof(const Inst *Inst) { return isClassof(Inst, Ucomiss); }
1105 1098
1106 private: 1099 private:
1107 InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2); 1100 InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2);
1108 InstX8632Ucomiss(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; 1101 InstX8632Ucomiss(const InstX8632Ucomiss &) = delete;
1109 InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; 1102 InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) = delete;
1110 ~InstX8632Ucomiss() override {} 1103 ~InstX8632Ucomiss() override {}
1111 }; 1104 };
1112 1105
1113 // UD2 instruction. 1106 // UD2 instruction.
1114 class InstX8632UD2 : public InstX8632 { 1107 class InstX8632UD2 : public InstX8632 {
1115 public: 1108 public:
1116 static InstX8632UD2 *create(Cfg *Func) { 1109 static InstX8632UD2 *create(Cfg *Func) {
1117 return new (Func->allocate<InstX8632UD2>()) InstX8632UD2(Func); 1110 return new (Func->allocate<InstX8632UD2>()) InstX8632UD2(Func);
1118 } 1111 }
1119 void emit(const Cfg *Func) const override; 1112 void emit(const Cfg *Func) const override;
1120 void dump(const Cfg *Func) const override; 1113 void dump(const Cfg *Func) const override;
1121 static bool classof(const Inst *Inst) { return isClassof(Inst, UD2); } 1114 static bool classof(const Inst *Inst) { return isClassof(Inst, UD2); }
1122 1115
1123 private: 1116 private:
1124 InstX8632UD2(Cfg *Func); 1117 InstX8632UD2(Cfg *Func);
1125 InstX8632UD2(const InstX8632UD2 &) LLVM_DELETED_FUNCTION; 1118 InstX8632UD2(const InstX8632UD2 &) = delete;
1126 InstX8632UD2 &operator=(const InstX8632UD2 &) LLVM_DELETED_FUNCTION; 1119 InstX8632UD2 &operator=(const InstX8632UD2 &) = delete;
1127 ~InstX8632UD2() override {} 1120 ~InstX8632UD2() override {}
1128 }; 1121 };
1129 1122
1130 // Test instruction. 1123 // Test instruction.
1131 class InstX8632Test : public InstX8632 { 1124 class InstX8632Test : public InstX8632 {
1132 public: 1125 public:
1133 static InstX8632Test *create(Cfg *Func, Operand *Source1, Operand *Source2) { 1126 static InstX8632Test *create(Cfg *Func, Operand *Source1, Operand *Source2) {
1134 return new (Func->allocate<InstX8632Test>()) 1127 return new (Func->allocate<InstX8632Test>())
1135 InstX8632Test(Func, Source1, Source2); 1128 InstX8632Test(Func, Source1, Source2);
1136 } 1129 }
1137 void emit(const Cfg *Func) const override; 1130 void emit(const Cfg *Func) const override;
1138 void dump(const Cfg *Func) const override; 1131 void dump(const Cfg *Func) const override;
1139 static bool classof(const Inst *Inst) { return isClassof(Inst, Test); } 1132 static bool classof(const Inst *Inst) { return isClassof(Inst, Test); }
1140 1133
1141 private: 1134 private:
1142 InstX8632Test(Cfg *Func, Operand *Source1, Operand *Source2); 1135 InstX8632Test(Cfg *Func, Operand *Source1, Operand *Source2);
1143 InstX8632Test(const InstX8632Test &) LLVM_DELETED_FUNCTION; 1136 InstX8632Test(const InstX8632Test &) = delete;
1144 InstX8632Test &operator=(const InstX8632Test &) LLVM_DELETED_FUNCTION; 1137 InstX8632Test &operator=(const InstX8632Test &) = delete;
1145 ~InstX8632Test() override {} 1138 ~InstX8632Test() override {}
1146 }; 1139 };
1147 1140
1148 // Mfence instruction. 1141 // Mfence instruction.
1149 class InstX8632Mfence : public InstX8632 { 1142 class InstX8632Mfence : public InstX8632 {
1150 public: 1143 public:
1151 static InstX8632Mfence *create(Cfg *Func) { 1144 static InstX8632Mfence *create(Cfg *Func) {
1152 return new (Func->allocate<InstX8632Mfence>()) InstX8632Mfence(Func); 1145 return new (Func->allocate<InstX8632Mfence>()) InstX8632Mfence(Func);
1153 } 1146 }
1154 void emit(const Cfg *Func) const override; 1147 void emit(const Cfg *Func) const override;
1155 void emitIAS(const Cfg *Func) const override; 1148 void emitIAS(const Cfg *Func) const override;
1156 void dump(const Cfg *Func) const override; 1149 void dump(const Cfg *Func) const override;
1157 static bool classof(const Inst *Inst) { return isClassof(Inst, Mfence); } 1150 static bool classof(const Inst *Inst) { return isClassof(Inst, Mfence); }
1158 1151
1159 private: 1152 private:
1160 InstX8632Mfence(Cfg *Func); 1153 InstX8632Mfence(Cfg *Func);
1161 InstX8632Mfence(const InstX8632Mfence &) LLVM_DELETED_FUNCTION; 1154 InstX8632Mfence(const InstX8632Mfence &) = delete;
1162 InstX8632Mfence &operator=(const InstX8632Mfence &) LLVM_DELETED_FUNCTION; 1155 InstX8632Mfence &operator=(const InstX8632Mfence &) = delete;
1163 ~InstX8632Mfence() override {} 1156 ~InstX8632Mfence() override {}
1164 }; 1157 };
1165 1158
1166 // This is essentially a "mov" instruction with an OperandX8632Mem 1159 // This is essentially a "mov" instruction with an OperandX8632Mem
1167 // operand instead of Variable as the destination. It's important 1160 // operand instead of Variable as the destination. It's important
1168 // for liveness that there is no Dest operand. 1161 // for liveness that there is no Dest operand.
1169 class InstX8632Store : public InstX8632 { 1162 class InstX8632Store : public InstX8632 {
1170 public: 1163 public:
1171 static InstX8632Store *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { 1164 static InstX8632Store *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
1172 return new (Func->allocate<InstX8632Store>()) 1165 return new (Func->allocate<InstX8632Store>())
1173 InstX8632Store(Func, Value, Mem); 1166 InstX8632Store(Func, Value, Mem);
1174 } 1167 }
1175 void emit(const Cfg *Func) const override; 1168 void emit(const Cfg *Func) const override;
1176 void dump(const Cfg *Func) const override; 1169 void dump(const Cfg *Func) const override;
1177 static bool classof(const Inst *Inst) { return isClassof(Inst, Store); } 1170 static bool classof(const Inst *Inst) { return isClassof(Inst, Store); }
1178 1171
1179 private: 1172 private:
1180 InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem); 1173 InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem);
1181 InstX8632Store(const InstX8632Store &) LLVM_DELETED_FUNCTION; 1174 InstX8632Store(const InstX8632Store &) = delete;
1182 InstX8632Store &operator=(const InstX8632Store &) LLVM_DELETED_FUNCTION; 1175 InstX8632Store &operator=(const InstX8632Store &) = delete;
1183 ~InstX8632Store() override {} 1176 ~InstX8632Store() override {}
1184 }; 1177 };
1185 1178
1186 class InstX8632StoreP : public InstX8632 { 1179 class InstX8632StoreP : public InstX8632 {
1187 public: 1180 public:
1188 static InstX8632StoreP *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { 1181 static InstX8632StoreP *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
1189 return new (Func->allocate<InstX8632StoreP>()) 1182 return new (Func->allocate<InstX8632StoreP>())
1190 InstX8632StoreP(Func, Value, Mem); 1183 InstX8632StoreP(Func, Value, Mem);
1191 } 1184 }
1192 void emit(const Cfg *Func) const override; 1185 void emit(const Cfg *Func) const override;
1193 void dump(const Cfg *Func) const override; 1186 void dump(const Cfg *Func) const override;
1194 static bool classof(const Inst *Inst) { return isClassof(Inst, StoreP); } 1187 static bool classof(const Inst *Inst) { return isClassof(Inst, StoreP); }
1195 1188
1196 private: 1189 private:
1197 InstX8632StoreP(Cfg *Func, Operand *Value, OperandX8632 *Mem); 1190 InstX8632StoreP(Cfg *Func, Operand *Value, OperandX8632 *Mem);
1198 InstX8632StoreP(const InstX8632StoreP &) LLVM_DELETED_FUNCTION; 1191 InstX8632StoreP(const InstX8632StoreP &) = delete;
1199 InstX8632StoreP &operator=(const InstX8632StoreP &) LLVM_DELETED_FUNCTION; 1192 InstX8632StoreP &operator=(const InstX8632StoreP &) = delete;
1200 ~InstX8632StoreP() override {} 1193 ~InstX8632StoreP() override {}
1201 }; 1194 };
1202 1195
1203 // This is essentially a "movq" instruction with an OperandX8632Mem 1196 // This is essentially a "movq" instruction with an OperandX8632Mem
1204 // operand instead of Variable as the destination. It's important 1197 // operand instead of Variable as the destination. It's important
1205 // for liveness that there is no Dest operand. 1198 // for liveness that there is no Dest operand.
1206 class InstX8632StoreQ : public InstX8632 { 1199 class InstX8632StoreQ : public InstX8632 {
1207 public: 1200 public:
1208 static InstX8632StoreQ *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { 1201 static InstX8632StoreQ *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
1209 return new (Func->allocate<InstX8632StoreQ>()) 1202 return new (Func->allocate<InstX8632StoreQ>())
1210 InstX8632StoreQ(Func, Value, Mem); 1203 InstX8632StoreQ(Func, Value, Mem);
1211 } 1204 }
1212 void emit(const Cfg *Func) const override; 1205 void emit(const Cfg *Func) const override;
1213 void dump(const Cfg *Func) const override; 1206 void dump(const Cfg *Func) const override;
1214 static bool classof(const Inst *Inst) { return isClassof(Inst, StoreQ); } 1207 static bool classof(const Inst *Inst) { return isClassof(Inst, StoreQ); }
1215 1208
1216 private: 1209 private:
1217 InstX8632StoreQ(Cfg *Func, Operand *Value, OperandX8632 *Mem); 1210 InstX8632StoreQ(Cfg *Func, Operand *Value, OperandX8632 *Mem);
1218 InstX8632StoreQ(const InstX8632StoreQ &) LLVM_DELETED_FUNCTION; 1211 InstX8632StoreQ(const InstX8632StoreQ &) = delete;
1219 InstX8632StoreQ &operator=(const InstX8632StoreQ &) LLVM_DELETED_FUNCTION; 1212 InstX8632StoreQ &operator=(const InstX8632StoreQ &) = delete;
1220 ~InstX8632StoreQ() override {} 1213 ~InstX8632StoreQ() override {}
1221 }; 1214 };
1222 1215
1223 // Movsx - copy from a narrower integer type to a wider integer 1216 // Movsx - copy from a narrower integer type to a wider integer
1224 // type, with sign extension. 1217 // type, with sign extension.
1225 class InstX8632Movsx : public InstX8632 { 1218 class InstX8632Movsx : public InstX8632 {
1226 public: 1219 public:
1227 static InstX8632Movsx *create(Cfg *Func, Variable *Dest, Operand *Source) { 1220 static InstX8632Movsx *create(Cfg *Func, Variable *Dest, Operand *Source) {
1228 return new (Func->allocate<InstX8632Movsx>()) 1221 return new (Func->allocate<InstX8632Movsx>())
1229 InstX8632Movsx(Func, Dest, Source); 1222 InstX8632Movsx(Func, Dest, Source);
1230 } 1223 }
1231 void emit(const Cfg *Func) const override; 1224 void emit(const Cfg *Func) const override;
1232 void dump(const Cfg *Func) const override; 1225 void dump(const Cfg *Func) const override;
1233 static bool classof(const Inst *Inst) { return isClassof(Inst, Movsx); } 1226 static bool classof(const Inst *Inst) { return isClassof(Inst, Movsx); }
1234 1227
1235 private: 1228 private:
1236 InstX8632Movsx(Cfg *Func, Variable *Dest, Operand *Source); 1229 InstX8632Movsx(Cfg *Func, Variable *Dest, Operand *Source);
1237 InstX8632Movsx(const InstX8632Movsx &) LLVM_DELETED_FUNCTION; 1230 InstX8632Movsx(const InstX8632Movsx &) = delete;
1238 InstX8632Movsx &operator=(const InstX8632Movsx &) LLVM_DELETED_FUNCTION; 1231 InstX8632Movsx &operator=(const InstX8632Movsx &) = delete;
1239 ~InstX8632Movsx() override {} 1232 ~InstX8632Movsx() override {}
1240 }; 1233 };
1241 1234
1242 // Movzx - copy from a narrower integer type to a wider integer 1235 // Movzx - copy from a narrower integer type to a wider integer
1243 // type, with zero extension. 1236 // type, with zero extension.
1244 class InstX8632Movzx : public InstX8632 { 1237 class InstX8632Movzx : public InstX8632 {
1245 public: 1238 public:
1246 static InstX8632Movzx *create(Cfg *Func, Variable *Dest, Operand *Source) { 1239 static InstX8632Movzx *create(Cfg *Func, Variable *Dest, Operand *Source) {
1247 return new (Func->allocate<InstX8632Movzx>()) 1240 return new (Func->allocate<InstX8632Movzx>())
1248 InstX8632Movzx(Func, Dest, Source); 1241 InstX8632Movzx(Func, Dest, Source);
1249 } 1242 }
1250 void emit(const Cfg *Func) const override; 1243 void emit(const Cfg *Func) const override;
1251 void dump(const Cfg *Func) const override; 1244 void dump(const Cfg *Func) const override;
1252 static bool classof(const Inst *Inst) { return isClassof(Inst, Movzx); } 1245 static bool classof(const Inst *Inst) { return isClassof(Inst, Movzx); }
1253 1246
1254 private: 1247 private:
1255 InstX8632Movzx(Cfg *Func, Variable *Dest, Operand *Source); 1248 InstX8632Movzx(Cfg *Func, Variable *Dest, Operand *Source);
1256 InstX8632Movzx(const InstX8632Movzx &) LLVM_DELETED_FUNCTION; 1249 InstX8632Movzx(const InstX8632Movzx &) = delete;
1257 InstX8632Movzx &operator=(const InstX8632Movzx &) LLVM_DELETED_FUNCTION; 1250 InstX8632Movzx &operator=(const InstX8632Movzx &) = delete;
1258 ~InstX8632Movzx() override {} 1251 ~InstX8632Movzx() override {}
1259 }; 1252 };
1260 1253
1261 // Nop instructions of varying length 1254 // Nop instructions of varying length
1262 class InstX8632Nop : public InstX8632 { 1255 class InstX8632Nop : public InstX8632 {
1263 public: 1256 public:
1264 // TODO: Replace with enum. 1257 // TODO: Replace with enum.
1265 typedef unsigned NopVariant; 1258 typedef unsigned NopVariant;
1266 1259
1267 static InstX8632Nop *create(Cfg *Func, NopVariant Variant) { 1260 static InstX8632Nop *create(Cfg *Func, NopVariant Variant) {
1268 return new (Func->allocate<InstX8632Nop>()) InstX8632Nop(Func, Variant); 1261 return new (Func->allocate<InstX8632Nop>()) InstX8632Nop(Func, Variant);
1269 } 1262 }
1270 void emit(const Cfg *Func) const override; 1263 void emit(const Cfg *Func) const override;
1271 void emitIAS(const Cfg *Func) const override; 1264 void emitIAS(const Cfg *Func) const override;
1272 void dump(const Cfg *Func) const override; 1265 void dump(const Cfg *Func) const override;
1273 static bool classof(const Inst *Inst) { return isClassof(Inst, Nop); } 1266 static bool classof(const Inst *Inst) { return isClassof(Inst, Nop); }
1274 1267
1275 private: 1268 private:
1276 InstX8632Nop(Cfg *Func, SizeT Length); 1269 InstX8632Nop(Cfg *Func, SizeT Length);
1277 InstX8632Nop(const InstX8632Nop &) LLVM_DELETED_FUNCTION; 1270 InstX8632Nop(const InstX8632Nop &) = delete;
1278 InstX8632Nop &operator=(const InstX8632Nop &) LLVM_DELETED_FUNCTION; 1271 InstX8632Nop &operator=(const InstX8632Nop &) = delete;
1279 ~InstX8632Nop() override {} 1272 ~InstX8632Nop() override {}
1280 1273
1281 NopVariant Variant; 1274 NopVariant Variant;
1282 }; 1275 };
1283 1276
1284 // Fld - load a value onto the x87 FP stack. 1277 // Fld - load a value onto the x87 FP stack.
1285 class InstX8632Fld : public InstX8632 { 1278 class InstX8632Fld : public InstX8632 {
1286 public: 1279 public:
1287 static InstX8632Fld *create(Cfg *Func, Operand *Src) { 1280 static InstX8632Fld *create(Cfg *Func, Operand *Src) {
1288 return new (Func->allocate<InstX8632Fld>()) InstX8632Fld(Func, Src); 1281 return new (Func->allocate<InstX8632Fld>()) InstX8632Fld(Func, Src);
1289 } 1282 }
1290 void emit(const Cfg *Func) const override; 1283 void emit(const Cfg *Func) const override;
1291 void dump(const Cfg *Func) const override; 1284 void dump(const Cfg *Func) const override;
1292 static bool classof(const Inst *Inst) { return isClassof(Inst, Fld); } 1285 static bool classof(const Inst *Inst) { return isClassof(Inst, Fld); }
1293 1286
1294 private: 1287 private:
1295 InstX8632Fld(Cfg *Func, Operand *Src); 1288 InstX8632Fld(Cfg *Func, Operand *Src);
1296 InstX8632Fld(const InstX8632Fld &) LLVM_DELETED_FUNCTION; 1289 InstX8632Fld(const InstX8632Fld &) = delete;
1297 InstX8632Fld &operator=(const InstX8632Fld &) LLVM_DELETED_FUNCTION; 1290 InstX8632Fld &operator=(const InstX8632Fld &) = delete;
1298 ~InstX8632Fld() override {} 1291 ~InstX8632Fld() override {}
1299 }; 1292 };
1300 1293
1301 // Fstp - store x87 st(0) into memory and pop st(0). 1294 // Fstp - store x87 st(0) into memory and pop st(0).
1302 class InstX8632Fstp : public InstX8632 { 1295 class InstX8632Fstp : public InstX8632 {
1303 public: 1296 public:
1304 static InstX8632Fstp *create(Cfg *Func, Variable *Dest) { 1297 static InstX8632Fstp *create(Cfg *Func, Variable *Dest) {
1305 return new (Func->allocate<InstX8632Fstp>()) InstX8632Fstp(Func, Dest); 1298 return new (Func->allocate<InstX8632Fstp>()) InstX8632Fstp(Func, Dest);
1306 } 1299 }
1307 void emit(const Cfg *Func) const override; 1300 void emit(const Cfg *Func) const override;
1308 void dump(const Cfg *Func) const override; 1301 void dump(const Cfg *Func) const override;
1309 static bool classof(const Inst *Inst) { return isClassof(Inst, Fstp); } 1302 static bool classof(const Inst *Inst) { return isClassof(Inst, Fstp); }
1310 1303
1311 private: 1304 private:
1312 InstX8632Fstp(Cfg *Func, Variable *Dest); 1305 InstX8632Fstp(Cfg *Func, Variable *Dest);
1313 InstX8632Fstp(const InstX8632Fstp &) LLVM_DELETED_FUNCTION; 1306 InstX8632Fstp(const InstX8632Fstp &) = delete;
1314 InstX8632Fstp &operator=(const InstX8632Fstp &) LLVM_DELETED_FUNCTION; 1307 InstX8632Fstp &operator=(const InstX8632Fstp &) = delete;
1315 ~InstX8632Fstp() override {} 1308 ~InstX8632Fstp() override {}
1316 }; 1309 };
1317 1310
1318 class InstX8632Pop : public InstX8632 { 1311 class InstX8632Pop : public InstX8632 {
1319 public: 1312 public:
1320 static InstX8632Pop *create(Cfg *Func, Variable *Dest) { 1313 static InstX8632Pop *create(Cfg *Func, Variable *Dest) {
1321 return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest); 1314 return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest);
1322 } 1315 }
1323 void emit(const Cfg *Func) const override; 1316 void emit(const Cfg *Func) const override;
1324 void emitIAS(const Cfg *Func) const override; 1317 void emitIAS(const Cfg *Func) const override;
1325 void dump(const Cfg *Func) const override; 1318 void dump(const Cfg *Func) const override;
1326 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); } 1319 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); }
1327 1320
1328 private: 1321 private:
1329 InstX8632Pop(Cfg *Func, Variable *Dest); 1322 InstX8632Pop(Cfg *Func, Variable *Dest);
1330 InstX8632Pop(const InstX8632Pop &) LLVM_DELETED_FUNCTION; 1323 InstX8632Pop(const InstX8632Pop &) = delete;
1331 InstX8632Pop &operator=(const InstX8632Pop &) LLVM_DELETED_FUNCTION; 1324 InstX8632Pop &operator=(const InstX8632Pop &) = delete;
1332 ~InstX8632Pop() override {} 1325 ~InstX8632Pop() override {}
1333 }; 1326 };
1334 1327
1335 class InstX8632Push : public InstX8632 { 1328 class InstX8632Push : public InstX8632 {
1336 public: 1329 public:
1337 static InstX8632Push *create(Cfg *Func, Operand *Source, 1330 static InstX8632Push *create(Cfg *Func, Operand *Source,
1338 bool SuppressStackAdjustment) { 1331 bool SuppressStackAdjustment) {
1339 return new (Func->allocate<InstX8632Push>()) 1332 return new (Func->allocate<InstX8632Push>())
1340 InstX8632Push(Func, Source, SuppressStackAdjustment); 1333 InstX8632Push(Func, Source, SuppressStackAdjustment);
1341 } 1334 }
1342 void emit(const Cfg *Func) const override; 1335 void emit(const Cfg *Func) const override;
1343 void dump(const Cfg *Func) const override; 1336 void dump(const Cfg *Func) const override;
1344 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); } 1337 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); }
1345 1338
1346 private: 1339 private:
1347 InstX8632Push(Cfg *Func, Operand *Source, bool SuppressStackAdjustment); 1340 InstX8632Push(Cfg *Func, Operand *Source, bool SuppressStackAdjustment);
1348 InstX8632Push(const InstX8632Push &) LLVM_DELETED_FUNCTION; 1341 InstX8632Push(const InstX8632Push &) = delete;
1349 InstX8632Push &operator=(const InstX8632Push &) LLVM_DELETED_FUNCTION; 1342 InstX8632Push &operator=(const InstX8632Push &) = delete;
1350 bool SuppressStackAdjustment; 1343 bool SuppressStackAdjustment;
1351 ~InstX8632Push() override {} 1344 ~InstX8632Push() override {}
1352 }; 1345 };
1353 1346
1354 // Ret instruction. Currently only supports the "ret" version that 1347 // Ret instruction. Currently only supports the "ret" version that
1355 // does not pop arguments. This instruction takes a Source operand 1348 // does not pop arguments. This instruction takes a Source operand
1356 // (for non-void returning functions) for liveness analysis, though 1349 // (for non-void returning functions) for liveness analysis, though
1357 // a FakeUse before the ret would do just as well. 1350 // a FakeUse before the ret would do just as well.
1358 class InstX8632Ret : public InstX8632 { 1351 class InstX8632Ret : public InstX8632 {
1359 public: 1352 public:
1360 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { 1353 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) {
1361 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); 1354 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source);
1362 } 1355 }
1363 void emit(const Cfg *Func) const override; 1356 void emit(const Cfg *Func) const override;
1364 void emitIAS(const Cfg *Func) const override; 1357 void emitIAS(const Cfg *Func) const override;
1365 void dump(const Cfg *Func) const override; 1358 void dump(const Cfg *Func) const override;
1366 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } 1359 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); }
1367 1360
1368 private: 1361 private:
1369 InstX8632Ret(Cfg *Func, Variable *Source); 1362 InstX8632Ret(Cfg *Func, Variable *Source);
1370 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION; 1363 InstX8632Ret(const InstX8632Ret &) = delete;
1371 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION; 1364 InstX8632Ret &operator=(const InstX8632Ret &) = delete;
1372 ~InstX8632Ret() override {} 1365 ~InstX8632Ret() override {}
1373 }; 1366 };
1374 1367
1375 // Exchanging Add instruction. Exchanges the first operand (destination 1368 // Exchanging Add instruction. Exchanges the first operand (destination
1376 // operand) with the second operand (source operand), then loads the sum 1369 // operand) with the second operand (source operand), then loads the sum
1377 // of the two values into the destination operand. The destination may be 1370 // of the two values into the destination operand. The destination may be
1378 // a register or memory, while the source must be a register. 1371 // a register or memory, while the source must be a register.
1379 // 1372 //
1380 // Both the dest and source are updated. The caller should then insert a 1373 // Both the dest and source are updated. The caller should then insert a
1381 // FakeDef to reflect the second udpate. 1374 // FakeDef to reflect the second udpate.
1382 class InstX8632Xadd : public InstX8632Lockable { 1375 class InstX8632Xadd : public InstX8632Lockable {
1383 public: 1376 public:
1384 static InstX8632Xadd *create(Cfg *Func, Operand *Dest, Variable *Source, 1377 static InstX8632Xadd *create(Cfg *Func, Operand *Dest, Variable *Source,
1385 bool Locked) { 1378 bool Locked) {
1386 return new (Func->allocate<InstX8632Xadd>()) 1379 return new (Func->allocate<InstX8632Xadd>())
1387 InstX8632Xadd(Func, Dest, Source, Locked); 1380 InstX8632Xadd(Func, Dest, Source, Locked);
1388 } 1381 }
1389 void emit(const Cfg *Func) const override; 1382 void emit(const Cfg *Func) const override;
1390 void emitIAS(const Cfg *Func) const override; 1383 void emitIAS(const Cfg *Func) const override;
1391 void dump(const Cfg *Func) const override; 1384 void dump(const Cfg *Func) const override;
1392 static bool classof(const Inst *Inst) { return isClassof(Inst, Xadd); } 1385 static bool classof(const Inst *Inst) { return isClassof(Inst, Xadd); }
1393 1386
1394 private: 1387 private:
1395 InstX8632Xadd(Cfg *Func, Operand *Dest, Variable *Source, bool Locked); 1388 InstX8632Xadd(Cfg *Func, Operand *Dest, Variable *Source, bool Locked);
1396 InstX8632Xadd(const InstX8632Xadd &) LLVM_DELETED_FUNCTION; 1389 InstX8632Xadd(const InstX8632Xadd &) = delete;
1397 InstX8632Xadd &operator=(const InstX8632Xadd &) LLVM_DELETED_FUNCTION; 1390 InstX8632Xadd &operator=(const InstX8632Xadd &) = delete;
1398 ~InstX8632Xadd() override {} 1391 ~InstX8632Xadd() override {}
1399 }; 1392 };
1400 1393
1401 // Exchange instruction. Exchanges the first operand (destination 1394 // Exchange instruction. Exchanges the first operand (destination
1402 // operand) with the second operand (source operand). At least one of 1395 // operand) with the second operand (source operand). At least one of
1403 // the operands must be a register (and the other can be reg or mem). 1396 // the operands must be a register (and the other can be reg or mem).
1404 // Both the Dest and Source are updated. If there is a memory operand, 1397 // Both the Dest and Source are updated. If there is a memory operand,
1405 // then the instruction is automatically "locked" without the need for 1398 // then the instruction is automatically "locked" without the need for
1406 // a lock prefix. 1399 // a lock prefix.
1407 class InstX8632Xchg : public InstX8632 { 1400 class InstX8632Xchg : public InstX8632 {
1408 public: 1401 public:
1409 static InstX8632Xchg *create(Cfg *Func, Operand *Dest, Variable *Source) { 1402 static InstX8632Xchg *create(Cfg *Func, Operand *Dest, Variable *Source) {
1410 return new (Func->allocate<InstX8632Xchg>()) 1403 return new (Func->allocate<InstX8632Xchg>())
1411 InstX8632Xchg(Func, Dest, Source); 1404 InstX8632Xchg(Func, Dest, Source);
1412 } 1405 }
1413 void emit(const Cfg *Func) const override; 1406 void emit(const Cfg *Func) const override;
1414 void emitIAS(const Cfg *Func) const override; 1407 void emitIAS(const Cfg *Func) const override;
1415 void dump(const Cfg *Func) const override; 1408 void dump(const Cfg *Func) const override;
1416 static bool classof(const Inst *Inst) { return isClassof(Inst, Xchg); } 1409 static bool classof(const Inst *Inst) { return isClassof(Inst, Xchg); }
1417 1410
1418 private: 1411 private:
1419 InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source); 1412 InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source);
1420 InstX8632Xchg(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; 1413 InstX8632Xchg(const InstX8632Xchg &) = delete;
1421 InstX8632Xchg &operator=(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; 1414 InstX8632Xchg &operator=(const InstX8632Xchg &) = delete;
1422 ~InstX8632Xchg() override {} 1415 ~InstX8632Xchg() override {}
1423 }; 1416 };
1424 1417
1425 // Declare partial template specializations of emit() methods that 1418 // Declare partial template specializations of emit() methods that
1426 // already have default implementations. Without this, there is the 1419 // already have default implementations. Without this, there is the
1427 // possibility of ODR violations and link errors. 1420 // possibility of ODR violations and link errors.
1428 template <> void InstX8632Addss::emit(const Cfg *Func) const; 1421 template <> void InstX8632Addss::emit(const Cfg *Func) const;
1429 template <> void InstX8632Blendvps::emit(const Cfg *Func) const; 1422 template <> void InstX8632Blendvps::emit(const Cfg *Func) const;
1430 template <> void InstX8632Cbwdq::emit(const Cfg *Func) const; 1423 template <> void InstX8632Cbwdq::emit(const Cfg *Func) const;
1431 template <> void InstX8632Div::emit(const Cfg *Func) const; 1424 template <> void InstX8632Div::emit(const Cfg *Func) const;
(...skipping 18 matching lines...) Expand all
1450 1443
1451 template <> void InstX8632Div::emitIAS(const Cfg *Func) const; 1444 template <> void InstX8632Div::emitIAS(const Cfg *Func) const;
1452 template <> void InstX8632Idiv::emitIAS(const Cfg *Func) const; 1445 template <> void InstX8632Idiv::emitIAS(const Cfg *Func) const;
1453 template <> void InstX8632Imul::emitIAS(const Cfg *Func) const; 1446 template <> void InstX8632Imul::emitIAS(const Cfg *Func) const;
1454 template <> void InstX8632Cbwdq::emitIAS(const Cfg *Func) const; 1447 template <> void InstX8632Cbwdq::emitIAS(const Cfg *Func) const;
1455 template <> void InstX8632Movd::emitIAS(const Cfg *Func) const; 1448 template <> void InstX8632Movd::emitIAS(const Cfg *Func) const;
1456 1449
1457 } // end of namespace Ice 1450 } // end of namespace Ice
1458 1451
1459 #endif // SUBZERO_SRC_ICEINSTX8632_H 1452 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « src/IceInst.h ('k') | src/IceIntrinsics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698