OLD | NEW |
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 |
11 // their subclasses. This represents the machine instructions and | 11 // their subclasses. This represents the machine instructions and |
12 // operands used for x86-32 code selection. | 12 // operands used for x86-32 code selection. |
13 // | 13 // |
14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
15 | 15 |
16 #ifndef SUBZERO_SRC_ICEINSTX8632_H | 16 #ifndef SUBZERO_SRC_ICEINSTX8632_H |
17 #define SUBZERO_SRC_ICEINSTX8632_H | 17 #define SUBZERO_SRC_ICEINSTX8632_H |
18 | 18 |
| 19 #include "assembler_ia32.h" |
19 #include "IceDefs.h" | 20 #include "IceDefs.h" |
20 #include "IceInst.h" | 21 #include "IceInst.h" |
21 #include "IceConditionCodesX8632.h" | 22 #include "IceConditionCodesX8632.h" |
22 #include "IceInstX8632.def" | 23 #include "IceInstX8632.def" |
23 #include "IceOperand.h" | 24 #include "IceOperand.h" |
24 | 25 |
25 namespace Ice { | 26 namespace Ice { |
26 | 27 |
27 class TargetX8632; | 28 class TargetX8632; |
28 | 29 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 uint16_t Shift = 0, | 69 uint16_t Shift = 0, |
69 SegmentRegisters SegmentReg = DefaultSegment) { | 70 SegmentRegisters SegmentReg = DefaultSegment) { |
70 return new (Func->allocate<OperandX8632Mem>()) | 71 return new (Func->allocate<OperandX8632Mem>()) |
71 OperandX8632Mem(Func, Ty, Base, Offset, Index, Shift, SegmentReg); | 72 OperandX8632Mem(Func, Ty, Base, Offset, Index, Shift, SegmentReg); |
72 } | 73 } |
73 Variable *getBase() const { return Base; } | 74 Variable *getBase() const { return Base; } |
74 Constant *getOffset() const { return Offset; } | 75 Constant *getOffset() const { return Offset; } |
75 Variable *getIndex() const { return Index; } | 76 Variable *getIndex() const { return Index; } |
76 uint16_t getShift() const { return Shift; } | 77 uint16_t getShift() const { return Shift; } |
77 SegmentRegisters getSegmentRegister() const { return SegmentReg; } | 78 SegmentRegisters getSegmentRegister() const { return SegmentReg; } |
| 79 x86::Address toAsmAddress(Assembler *Asm) const; |
78 virtual void emit(const Cfg *Func) const; | 80 virtual void emit(const Cfg *Func) const; |
79 using OperandX8632::dump; | 81 using OperandX8632::dump; |
80 virtual void dump(const Cfg *Func, Ostream &Str) const; | 82 virtual void dump(const Cfg *Func, Ostream &Str) const; |
81 | 83 |
82 static bool classof(const Operand *Operand) { | 84 static bool classof(const Operand *Operand) { |
83 return Operand->getKind() == static_cast<OperandKind>(kMem); | 85 return Operand->getKind() == static_cast<OperandKind>(kMem); |
84 } | 86 } |
85 | 87 |
86 private: | 88 private: |
87 OperandX8632Mem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset, | 89 OperandX8632Mem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset, |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 391 |
390 // AdjustStack instruction - subtracts esp by the given amount and | 392 // AdjustStack instruction - subtracts esp by the given amount and |
391 // updates the stack offset during code emission. | 393 // updates the stack offset during code emission. |
392 class InstX8632AdjustStack : public InstX8632 { | 394 class InstX8632AdjustStack : public InstX8632 { |
393 public: | 395 public: |
394 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) { | 396 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) { |
395 return new (Func->allocate<InstX8632AdjustStack>()) | 397 return new (Func->allocate<InstX8632AdjustStack>()) |
396 InstX8632AdjustStack(Func, Amount, Esp); | 398 InstX8632AdjustStack(Func, Amount, Esp); |
397 } | 399 } |
398 virtual void emit(const Cfg *Func) const; | 400 virtual void emit(const Cfg *Func) const; |
| 401 virtual void emitIAS(const Cfg *Func) const; |
399 virtual void dump(const Cfg *Func) const; | 402 virtual void dump(const Cfg *Func) const; |
400 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); } | 403 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); } |
401 | 404 |
402 private: | 405 private: |
403 InstX8632AdjustStack(Cfg *Func, SizeT Amount, Variable *Esp); | 406 InstX8632AdjustStack(Cfg *Func, SizeT Amount, Variable *Esp); |
404 InstX8632AdjustStack(const InstX8632AdjustStack &) LLVM_DELETED_FUNCTION; | 407 InstX8632AdjustStack(const InstX8632AdjustStack &) LLVM_DELETED_FUNCTION; |
405 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) | 408 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) |
406 LLVM_DELETED_FUNCTION; | 409 LLVM_DELETED_FUNCTION; |
407 SizeT Amount; | 410 SizeT Amount; |
408 }; | 411 }; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 } | 474 } |
472 virtual void emit(const Cfg *Func) const { | 475 virtual void emit(const Cfg *Func) const { |
473 Ostream &Str = Func->getContext()->getStrEmit(); | 476 Ostream &Str = Func->getContext()->getStrEmit(); |
474 assert(getSrcSize() == 1); | 477 assert(getSrcSize() == 1); |
475 Str << "\t" << Opcode << "\t"; | 478 Str << "\t" << Opcode << "\t"; |
476 getDest()->emit(Func); | 479 getDest()->emit(Func); |
477 Str << ", "; | 480 Str << ", "; |
478 getSrc(0)->emit(Func); | 481 getSrc(0)->emit(Func); |
479 Str << "\n"; | 482 Str << "\n"; |
480 } | 483 } |
| 484 virtual void emitIAS(const Cfg *Func) const { emit(Func); } |
481 virtual void dump(const Cfg *Func) const { | 485 virtual void dump(const Cfg *Func) const { |
482 Ostream &Str = Func->getContext()->getStrDump(); | 486 Ostream &Str = Func->getContext()->getStrDump(); |
483 dumpDest(Func); | 487 dumpDest(Func); |
484 Str << " = " << Opcode << "." << getDest()->getType() << " "; | 488 Str << " = " << Opcode << "." << getDest()->getType() << " "; |
485 dumpSources(Func); | 489 dumpSources(Func); |
486 } | 490 } |
487 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } | 491 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } |
488 | 492 |
489 private: | 493 private: |
490 InstX8632Unaryop(Cfg *Func, Variable *Dest, Operand *Src) | 494 InstX8632Unaryop(Cfg *Func, Variable *Dest, Operand *Src) |
491 : InstX8632(Func, K, 1, Dest) { | 495 : InstX8632(Func, K, 1, Dest) { |
492 addSource(Src); | 496 addSource(Src); |
493 } | 497 } |
494 InstX8632Unaryop(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION; | 498 InstX8632Unaryop(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION; |
495 InstX8632Unaryop &operator=(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION; | 499 InstX8632Unaryop &operator=(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION; |
496 virtual ~InstX8632Unaryop() {} | 500 virtual ~InstX8632Unaryop() {} |
497 static const char *Opcode; | 501 static const char *Opcode; |
498 }; | 502 }; |
499 | 503 |
| 504 void emitIASVarOperandTyXMM(const Cfg *Func, Type Ty, const Variable *Var, |
| 505 const Operand *Src, |
| 506 const x86::AssemblerX86::TypedXmmEmitters &Emitter); |
| 507 |
| 508 template <InstX8632::InstKindX8632 K> |
| 509 class InstX8632UnaryopXmm : public InstX8632 { |
| 510 public: |
| 511 static InstX8632UnaryopXmm *create(Cfg *Func, Variable *Dest, Operand *Src) { |
| 512 return new (Func->allocate<InstX8632UnaryopXmm>()) |
| 513 InstX8632UnaryopXmm(Func, Dest, Src); |
| 514 } |
| 515 virtual void emit(const Cfg *Func) const { |
| 516 Ostream &Str = Func->getContext()->getStrEmit(); |
| 517 assert(getSrcSize() == 1); |
| 518 Str << "\t" << Opcode << "\t"; |
| 519 getDest()->emit(Func); |
| 520 Str << ", "; |
| 521 getSrc(0)->emit(Func); |
| 522 Str << "\n"; |
| 523 } |
| 524 virtual void emitIAS(const Cfg *Func) const { |
| 525 Type Ty = getDest()->getType(); |
| 526 assert(getSrcSize() == 1); |
| 527 emitIASVarOperandTyXMM(Func, Ty, getDest(), getSrc(0), Emitter); |
| 528 } |
| 529 virtual void dump(const Cfg *Func) const { |
| 530 Ostream &Str = Func->getContext()->getStrDump(); |
| 531 dumpDest(Func); |
| 532 Str << " = " << Opcode << "." << getDest()->getType() << " "; |
| 533 dumpSources(Func); |
| 534 } |
| 535 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } |
| 536 |
| 537 private: |
| 538 InstX8632UnaryopXmm(Cfg *Func, Variable *Dest, Operand *Src) |
| 539 : InstX8632(Func, K, 1, Dest) { |
| 540 addSource(Src); |
| 541 } |
| 542 InstX8632UnaryopXmm(const InstX8632UnaryopXmm &) LLVM_DELETED_FUNCTION; |
| 543 InstX8632UnaryopXmm & |
| 544 operator=(const InstX8632UnaryopXmm &) LLVM_DELETED_FUNCTION; |
| 545 virtual ~InstX8632UnaryopXmm() {} |
| 546 static const char *Opcode; |
| 547 static const x86::AssemblerX86::TypedXmmEmitters Emitter; |
| 548 }; |
| 549 |
500 // See the definition of emitTwoAddress() for a description of | 550 // See the definition of emitTwoAddress() for a description of |
501 // ShiftHack. | 551 // ShiftHack. |
502 void emitTwoAddress(const char *Opcode, const Inst *Inst, const Cfg *Func, | 552 void emitTwoAddress(const char *Opcode, const Inst *Inst, const Cfg *Func, |
503 bool ShiftHack = false); | 553 bool ShiftHack = false); |
504 | 554 |
505 template <InstX8632::InstKindX8632 K, bool ShiftHack = false> | 555 template <InstX8632::InstKindX8632 K, bool ShiftHack = false> |
506 class InstX8632Binop : public InstX8632 { | 556 class InstX8632Binop : public InstX8632 { |
507 public: | 557 public: |
508 // Create an ordinary binary-op instruction like add or sub. | 558 // Create an ordinary binary-op instruction like add or sub. |
509 static InstX8632Binop *create(Cfg *Func, Variable *Dest, Operand *Source) { | 559 static InstX8632Binop *create(Cfg *Func, Variable *Dest, Operand *Source) { |
(...skipping 16 matching lines...) Expand all Loading... |
526 : InstX8632(Func, K, 2, Dest) { | 576 : InstX8632(Func, K, 2, Dest) { |
527 addSource(Dest); | 577 addSource(Dest); |
528 addSource(Source); | 578 addSource(Source); |
529 } | 579 } |
530 InstX8632Binop(const InstX8632Binop &) LLVM_DELETED_FUNCTION; | 580 InstX8632Binop(const InstX8632Binop &) LLVM_DELETED_FUNCTION; |
531 InstX8632Binop &operator=(const InstX8632Binop &) LLVM_DELETED_FUNCTION; | 581 InstX8632Binop &operator=(const InstX8632Binop &) LLVM_DELETED_FUNCTION; |
532 virtual ~InstX8632Binop() {} | 582 virtual ~InstX8632Binop() {} |
533 static const char *Opcode; | 583 static const char *Opcode; |
534 }; | 584 }; |
535 | 585 |
| 586 template <InstX8632::InstKindX8632 K, bool NeedsElementType> |
| 587 class InstX8632BinopXmm : public InstX8632 { |
| 588 public: |
| 589 // Create an XMM binary-op instruction like addss or addps. |
| 590 static InstX8632BinopXmm *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 591 return new (Func->allocate<InstX8632BinopXmm>()) |
| 592 InstX8632BinopXmm(Func, Dest, Source); |
| 593 } |
| 594 virtual void emit(const Cfg *Func) const { |
| 595 const bool ShiftHack = false; |
| 596 emitTwoAddress(Opcode, this, Func, ShiftHack); |
| 597 } |
| 598 virtual void emitIAS(const Cfg *Func) const { |
| 599 Type Ty = getDest()->getType(); |
| 600 if (NeedsElementType) |
| 601 Ty = typeElementType(Ty); |
| 602 assert(getSrcSize() == 2); |
| 603 emitIASVarOperandTyXMM(Func, Ty, getDest(), getSrc(1), Emitter); |
| 604 } |
| 605 virtual void dump(const Cfg *Func) const { |
| 606 Ostream &Str = Func->getContext()->getStrDump(); |
| 607 dumpDest(Func); |
| 608 Str << " = " << Opcode << "." << getDest()->getType() << " "; |
| 609 dumpSources(Func); |
| 610 } |
| 611 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } |
| 612 |
| 613 private: |
| 614 InstX8632BinopXmm(Cfg *Func, Variable *Dest, Operand *Source) |
| 615 : InstX8632(Func, K, 2, Dest) { |
| 616 addSource(Dest); |
| 617 addSource(Source); |
| 618 } |
| 619 InstX8632BinopXmm(const InstX8632BinopXmm &) LLVM_DELETED_FUNCTION; |
| 620 InstX8632BinopXmm &operator=(const InstX8632BinopXmm &) LLVM_DELETED_FUNCTION; |
| 621 virtual ~InstX8632BinopXmm() {} |
| 622 static const char *Opcode; |
| 623 static const x86::AssemblerX86::TypedXmmEmitters Emitter; |
| 624 }; |
| 625 |
536 template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 { | 626 template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 { |
537 public: | 627 public: |
538 // Create a ternary-op instruction like div or idiv. | 628 // Create a ternary-op instruction like div or idiv. |
539 static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1, | 629 static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1, |
540 Operand *Source2) { | 630 Operand *Source2) { |
541 return new (Func->allocate<InstX8632Ternop>()) | 631 return new (Func->allocate<InstX8632Ternop>()) |
542 InstX8632Ternop(Func, Dest, Source1, Source2); | 632 InstX8632Ternop(Func, Dest, Source1, Source2); |
543 } | 633 } |
544 virtual void emit(const Cfg *Func) const { | 634 virtual void emit(const Cfg *Func) const { |
545 Ostream &Str = Func->getContext()->getStrEmit(); | 635 Ostream &Str = Func->getContext()->getStrEmit(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 740 |
651 static const char *Opcode; | 741 static const char *Opcode; |
652 }; | 742 }; |
653 | 743 |
654 typedef InstX8632Inplaceop<InstX8632::Bswap> InstX8632Bswap; | 744 typedef InstX8632Inplaceop<InstX8632::Bswap> InstX8632Bswap; |
655 typedef InstX8632Inplaceop<InstX8632::Neg> InstX8632Neg; | 745 typedef InstX8632Inplaceop<InstX8632::Neg> InstX8632Neg; |
656 typedef InstX8632Unaryop<InstX8632::Bsf> InstX8632Bsf; | 746 typedef InstX8632Unaryop<InstX8632::Bsf> InstX8632Bsf; |
657 typedef InstX8632Unaryop<InstX8632::Bsr> InstX8632Bsr; | 747 typedef InstX8632Unaryop<InstX8632::Bsr> InstX8632Bsr; |
658 typedef InstX8632Unaryop<InstX8632::Lea> InstX8632Lea; | 748 typedef InstX8632Unaryop<InstX8632::Lea> InstX8632Lea; |
659 typedef InstX8632Unaryop<InstX8632::Movd> InstX8632Movd; | 749 typedef InstX8632Unaryop<InstX8632::Movd> InstX8632Movd; |
660 typedef InstX8632Unaryop<InstX8632::Sqrtss> InstX8632Sqrtss; | 750 typedef InstX8632UnaryopXmm<InstX8632::Sqrtss> InstX8632Sqrtss; |
661 // Cbwdq instruction - wrapper for cbw, cwd, and cdq | 751 // Cbwdq instruction - wrapper for cbw, cwd, and cdq |
662 typedef InstX8632Unaryop<InstX8632::Cbwdq> InstX8632Cbwdq; | 752 typedef InstX8632Unaryop<InstX8632::Cbwdq> InstX8632Cbwdq; |
663 // Move/assignment instruction - wrapper for mov/movss/movsd. | 753 // Move/assignment instruction - wrapper for mov/movss/movsd. |
664 typedef InstX8632Movlike<InstX8632::Mov> InstX8632Mov; | 754 typedef InstX8632Movlike<InstX8632::Mov> InstX8632Mov; |
665 // Move packed - copy 128 bit values between XMM registers, or mem128 | 755 // Move packed - copy 128 bit values between XMM registers, or mem128 |
666 // and XMM registers. | 756 // and XMM registers. |
667 typedef InstX8632Movlike<InstX8632::Movp> InstX8632Movp; | 757 typedef InstX8632Movlike<InstX8632::Movp> InstX8632Movp; |
668 // Movq - copy between XMM registers, or mem64 and XMM registers. | 758 // Movq - copy between XMM registers, or mem64 and XMM registers. |
669 typedef InstX8632Movlike<InstX8632::Movq> InstX8632Movq; | 759 typedef InstX8632Movlike<InstX8632::Movq> InstX8632Movq; |
670 typedef InstX8632Binop<InstX8632::Add> InstX8632Add; | 760 typedef InstX8632Binop<InstX8632::Add> InstX8632Add; |
671 typedef InstX8632Binop<InstX8632::Addps> InstX8632Addps; | 761 typedef InstX8632BinopXmm<InstX8632::Addps, true> InstX8632Addps; |
672 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc; | 762 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc; |
673 typedef InstX8632Binop<InstX8632::Addss> InstX8632Addss; | 763 typedef InstX8632BinopXmm<InstX8632::Addss, false> InstX8632Addss; |
674 typedef InstX8632Binop<InstX8632::Padd> InstX8632Padd; | 764 typedef InstX8632BinopXmm<InstX8632::Padd, true> InstX8632Padd; |
675 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub; | 765 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub; |
676 typedef InstX8632Binop<InstX8632::Subps> InstX8632Subps; | 766 typedef InstX8632BinopXmm<InstX8632::Subps, true> InstX8632Subps; |
677 typedef InstX8632Binop<InstX8632::Subss> InstX8632Subss; | 767 typedef InstX8632BinopXmm<InstX8632::Subss, false> InstX8632Subss; |
678 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb; | 768 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb; |
679 typedef InstX8632Binop<InstX8632::Psub> InstX8632Psub; | 769 typedef InstX8632BinopXmm<InstX8632::Psub, true> InstX8632Psub; |
680 typedef InstX8632Binop<InstX8632::And> InstX8632And; | 770 typedef InstX8632Binop<InstX8632::And> InstX8632And; |
681 typedef InstX8632Binop<InstX8632::Pand> InstX8632Pand; | 771 typedef InstX8632BinopXmm<InstX8632::Pand, false> InstX8632Pand; |
682 typedef InstX8632Binop<InstX8632::Pandn> InstX8632Pandn; | 772 typedef InstX8632BinopXmm<InstX8632::Pandn, false> InstX8632Pandn; |
683 typedef InstX8632Binop<InstX8632::Or> InstX8632Or; | 773 typedef InstX8632Binop<InstX8632::Or> InstX8632Or; |
684 typedef InstX8632Binop<InstX8632::Por> InstX8632Por; | 774 typedef InstX8632BinopXmm<InstX8632::Por, false> InstX8632Por; |
685 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor; | 775 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor; |
686 typedef InstX8632Binop<InstX8632::Pxor> InstX8632Pxor; | 776 typedef InstX8632BinopXmm<InstX8632::Pxor, false> InstX8632Pxor; |
687 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul; | 777 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul; |
688 typedef InstX8632Binop<InstX8632::Mulps> InstX8632Mulps; | 778 typedef InstX8632BinopXmm<InstX8632::Mulps, true> InstX8632Mulps; |
689 typedef InstX8632Binop<InstX8632::Mulss> InstX8632Mulss; | 779 typedef InstX8632BinopXmm<InstX8632::Mulss, false> InstX8632Mulss; |
690 typedef InstX8632Binop<InstX8632::Pmull> InstX8632Pmull; | 780 typedef InstX8632Binop<InstX8632::Pmull> InstX8632Pmull; |
691 typedef InstX8632Binop<InstX8632::Pmuludq> InstX8632Pmuludq; | 781 typedef InstX8632BinopXmm<InstX8632::Pmuludq, false> InstX8632Pmuludq; |
692 typedef InstX8632Binop<InstX8632::Divps> InstX8632Divps; | 782 typedef InstX8632BinopXmm<InstX8632::Divps, true> InstX8632Divps; |
693 typedef InstX8632Binop<InstX8632::Divss> InstX8632Divss; | 783 typedef InstX8632BinopXmm<InstX8632::Divss, false> InstX8632Divss; |
694 typedef InstX8632Binop<InstX8632::Rol, true> InstX8632Rol; | 784 typedef InstX8632Binop<InstX8632::Rol, true> InstX8632Rol; |
695 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl; | 785 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl; |
696 typedef InstX8632Binop<InstX8632::Psll> InstX8632Psll; | 786 typedef InstX8632Binop<InstX8632::Psll> InstX8632Psll; |
697 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr; | 787 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr; |
698 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar; | 788 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar; |
699 typedef InstX8632Binop<InstX8632::Psra> InstX8632Psra; | 789 typedef InstX8632Binop<InstX8632::Psra> InstX8632Psra; |
700 typedef InstX8632Binop<InstX8632::Pcmpeq> InstX8632Pcmpeq; | 790 typedef InstX8632Binop<InstX8632::Pcmpeq> InstX8632Pcmpeq; |
701 typedef InstX8632Binop<InstX8632::Pcmpgt> InstX8632Pcmpgt; | 791 typedef InstX8632Binop<InstX8632::Pcmpgt> InstX8632Pcmpgt; |
702 // TODO: movss is only a binary operation when the source and dest | 792 // TODO: movss is only a binary operation when the source and dest |
703 // operands are both registers. In other cases, it behaves like a copy | 793 // operands are both registers. In other cases, it behaves like a copy |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 // Cmpps instruction - compare packed singled-precision floating point | 911 // Cmpps instruction - compare packed singled-precision floating point |
822 // values | 912 // values |
823 class InstX8632Cmpps : public InstX8632 { | 913 class InstX8632Cmpps : public InstX8632 { |
824 public: | 914 public: |
825 static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source, | 915 static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source, |
826 CondX86::CmppsCond Condition) { | 916 CondX86::CmppsCond Condition) { |
827 return new (Func->allocate<InstX8632Cmpps>()) | 917 return new (Func->allocate<InstX8632Cmpps>()) |
828 InstX8632Cmpps(Func, Dest, Source, Condition); | 918 InstX8632Cmpps(Func, Dest, Source, Condition); |
829 } | 919 } |
830 virtual void emit(const Cfg *Func) const; | 920 virtual void emit(const Cfg *Func) const; |
| 921 virtual void emitIAS(const Cfg *Func) const; |
831 virtual void dump(const Cfg *Func) const; | 922 virtual void dump(const Cfg *Func) const; |
832 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpps); } | 923 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpps); } |
833 | 924 |
834 private: | 925 private: |
835 InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source, | 926 InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source, |
836 CondX86::CmppsCond Cond); | 927 CondX86::CmppsCond Cond); |
837 InstX8632Cmpps(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; | 928 InstX8632Cmpps(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; |
838 InstX8632Cmpps &operator=(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; | 929 InstX8632Cmpps &operator=(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; |
839 virtual ~InstX8632Cmpps() {} | 930 virtual ~InstX8632Cmpps() {} |
840 | 931 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 }; | 1025 }; |
935 | 1026 |
936 // ucomiss/ucomisd - floating-point compare instruction. | 1027 // ucomiss/ucomisd - floating-point compare instruction. |
937 class InstX8632Ucomiss : public InstX8632 { | 1028 class InstX8632Ucomiss : public InstX8632 { |
938 public: | 1029 public: |
939 static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) { | 1030 static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) { |
940 return new (Func->allocate<InstX8632Ucomiss>()) | 1031 return new (Func->allocate<InstX8632Ucomiss>()) |
941 InstX8632Ucomiss(Func, Src1, Src2); | 1032 InstX8632Ucomiss(Func, Src1, Src2); |
942 } | 1033 } |
943 virtual void emit(const Cfg *Func) const; | 1034 virtual void emit(const Cfg *Func) const; |
| 1035 virtual void emitIAS(const Cfg *Func) const; |
944 virtual void dump(const Cfg *Func) const; | 1036 virtual void dump(const Cfg *Func) const; |
945 static bool classof(const Inst *Inst) { return isClassof(Inst, Ucomiss); } | 1037 static bool classof(const Inst *Inst) { return isClassof(Inst, Ucomiss); } |
946 | 1038 |
947 private: | 1039 private: |
948 InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2); | 1040 InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2); |
949 InstX8632Ucomiss(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; | 1041 InstX8632Ucomiss(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; |
950 InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; | 1042 InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; |
951 virtual ~InstX8632Ucomiss() {} | 1043 virtual ~InstX8632Ucomiss() {} |
952 }; | 1044 }; |
953 | 1045 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 // Nop instructions of varying length | 1193 // Nop instructions of varying length |
1102 class InstX8632Nop : public InstX8632 { | 1194 class InstX8632Nop : public InstX8632 { |
1103 public: | 1195 public: |
1104 // TODO: Replace with enum. | 1196 // TODO: Replace with enum. |
1105 typedef unsigned NopVariant; | 1197 typedef unsigned NopVariant; |
1106 | 1198 |
1107 static InstX8632Nop *create(Cfg *Func, NopVariant Variant) { | 1199 static InstX8632Nop *create(Cfg *Func, NopVariant Variant) { |
1108 return new (Func->allocate<InstX8632Nop>()) InstX8632Nop(Func, Variant); | 1200 return new (Func->allocate<InstX8632Nop>()) InstX8632Nop(Func, Variant); |
1109 } | 1201 } |
1110 virtual void emit(const Cfg *Func) const; | 1202 virtual void emit(const Cfg *Func) const; |
| 1203 virtual void emitIAS(const Cfg *Func) const; |
1111 virtual void dump(const Cfg *Func) const; | 1204 virtual void dump(const Cfg *Func) const; |
1112 static bool classof(const Inst *Inst) { return isClassof(Inst, Nop); } | 1205 static bool classof(const Inst *Inst) { return isClassof(Inst, Nop); } |
1113 | 1206 |
1114 private: | 1207 private: |
1115 InstX8632Nop(Cfg *Func, SizeT Length); | 1208 InstX8632Nop(Cfg *Func, SizeT Length); |
1116 InstX8632Nop(const InstX8632Nop &) LLVM_DELETED_FUNCTION; | 1209 InstX8632Nop(const InstX8632Nop &) LLVM_DELETED_FUNCTION; |
1117 InstX8632Nop &operator=(const InstX8632Nop &) LLVM_DELETED_FUNCTION; | 1210 InstX8632Nop &operator=(const InstX8632Nop &) LLVM_DELETED_FUNCTION; |
1118 virtual ~InstX8632Nop() {} | 1211 virtual ~InstX8632Nop() {} |
1119 | 1212 |
1120 NopVariant Variant; | 1213 NopVariant Variant; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 InstX8632Fstp &operator=(const InstX8632Fstp &) LLVM_DELETED_FUNCTION; | 1246 InstX8632Fstp &operator=(const InstX8632Fstp &) LLVM_DELETED_FUNCTION; |
1154 virtual ~InstX8632Fstp() {} | 1247 virtual ~InstX8632Fstp() {} |
1155 }; | 1248 }; |
1156 | 1249 |
1157 class InstX8632Pop : public InstX8632 { | 1250 class InstX8632Pop : public InstX8632 { |
1158 public: | 1251 public: |
1159 static InstX8632Pop *create(Cfg *Func, Variable *Dest) { | 1252 static InstX8632Pop *create(Cfg *Func, Variable *Dest) { |
1160 return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest); | 1253 return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest); |
1161 } | 1254 } |
1162 virtual void emit(const Cfg *Func) const; | 1255 virtual void emit(const Cfg *Func) const; |
| 1256 virtual void emitIAS(const Cfg *Func) const; |
1163 virtual void dump(const Cfg *Func) const; | 1257 virtual void dump(const Cfg *Func) const; |
1164 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); } | 1258 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); } |
1165 | 1259 |
1166 private: | 1260 private: |
1167 InstX8632Pop(Cfg *Func, Variable *Dest); | 1261 InstX8632Pop(Cfg *Func, Variable *Dest); |
1168 InstX8632Pop(const InstX8632Pop &) LLVM_DELETED_FUNCTION; | 1262 InstX8632Pop(const InstX8632Pop &) LLVM_DELETED_FUNCTION; |
1169 InstX8632Pop &operator=(const InstX8632Pop &) LLVM_DELETED_FUNCTION; | 1263 InstX8632Pop &operator=(const InstX8632Pop &) LLVM_DELETED_FUNCTION; |
1170 virtual ~InstX8632Pop() {} | 1264 virtual ~InstX8632Pop() {} |
1171 }; | 1265 }; |
1172 | 1266 |
(...skipping 19 matching lines...) Expand all Loading... |
1192 // Ret instruction. Currently only supports the "ret" version that | 1286 // Ret instruction. Currently only supports the "ret" version that |
1193 // does not pop arguments. This instruction takes a Source operand | 1287 // does not pop arguments. This instruction takes a Source operand |
1194 // (for non-void returning functions) for liveness analysis, though | 1288 // (for non-void returning functions) for liveness analysis, though |
1195 // a FakeUse before the ret would do just as well. | 1289 // a FakeUse before the ret would do just as well. |
1196 class InstX8632Ret : public InstX8632 { | 1290 class InstX8632Ret : public InstX8632 { |
1197 public: | 1291 public: |
1198 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { | 1292 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { |
1199 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); | 1293 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); |
1200 } | 1294 } |
1201 virtual void emit(const Cfg *Func) const; | 1295 virtual void emit(const Cfg *Func) const; |
| 1296 virtual void emitIAS(const Cfg *Func) const; |
1202 virtual void dump(const Cfg *Func) const; | 1297 virtual void dump(const Cfg *Func) const; |
1203 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } | 1298 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } |
1204 | 1299 |
1205 private: | 1300 private: |
1206 InstX8632Ret(Cfg *Func, Variable *Source); | 1301 InstX8632Ret(Cfg *Func, Variable *Source); |
1207 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION; | 1302 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION; |
1208 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION; | 1303 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION; |
1209 virtual ~InstX8632Ret() {} | 1304 virtual ~InstX8632Ret() {} |
1210 }; | 1305 }; |
1211 | 1306 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const; | 1374 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const; |
1280 template <> void InstX8632Psll::emit(const Cfg *Func) const; | 1375 template <> void InstX8632Psll::emit(const Cfg *Func) const; |
1281 template <> void InstX8632Psra::emit(const Cfg *Func) const; | 1376 template <> void InstX8632Psra::emit(const Cfg *Func) const; |
1282 template <> void InstX8632Psub::emit(const Cfg *Func) const; | 1377 template <> void InstX8632Psub::emit(const Cfg *Func) const; |
1283 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const; | 1378 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const; |
1284 template <> void InstX8632Subss::emit(const Cfg *Func) const; | 1379 template <> void InstX8632Subss::emit(const Cfg *Func) const; |
1285 | 1380 |
1286 } // end of namespace Ice | 1381 } // end of namespace Ice |
1287 | 1382 |
1288 #endif // SUBZERO_SRC_ICEINSTX8632_H | 1383 #endif // SUBZERO_SRC_ICEINSTX8632_H |
OLD | NEW |