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

Side by Side Diff: src/IceInstX8632.h

Issue 574133002: Add initial integrated assembler w/ some Xmm ops. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: more cleanup Created 6 years, 3 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
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
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
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 366
365 // AdjustStack instruction - subtracts esp by the given amount and 367 // AdjustStack instruction - subtracts esp by the given amount and
366 // updates the stack offset during code emission. 368 // updates the stack offset during code emission.
367 class InstX8632AdjustStack : public InstX8632 { 369 class InstX8632AdjustStack : public InstX8632 {
368 public: 370 public:
369 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount) { 371 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount) {
370 return new (Func->allocate<InstX8632AdjustStack>()) 372 return new (Func->allocate<InstX8632AdjustStack>())
371 InstX8632AdjustStack(Func, Amount); 373 InstX8632AdjustStack(Func, Amount);
372 } 374 }
373 virtual void emit(const Cfg *Func) const; 375 virtual void emit(const Cfg *Func) const;
376 virtual void emitIAS(const Cfg *Func) const;
374 virtual void dump(const Cfg *Func) const; 377 virtual void dump(const Cfg *Func) const;
375 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); } 378 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); }
376 379
377 private: 380 private:
378 InstX8632AdjustStack(Cfg *Func, SizeT Amount); 381 InstX8632AdjustStack(Cfg *Func, SizeT Amount);
379 InstX8632AdjustStack(const InstX8632AdjustStack &) LLVM_DELETED_FUNCTION; 382 InstX8632AdjustStack(const InstX8632AdjustStack &) LLVM_DELETED_FUNCTION;
380 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) 383 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &)
381 LLVM_DELETED_FUNCTION; 384 LLVM_DELETED_FUNCTION;
382 SizeT Amount; 385 SizeT Amount;
383 }; 386 };
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 } 449 }
447 virtual void emit(const Cfg *Func) const { 450 virtual void emit(const Cfg *Func) const {
448 Ostream &Str = Func->getContext()->getStrEmit(); 451 Ostream &Str = Func->getContext()->getStrEmit();
449 assert(getSrcSize() == 1); 452 assert(getSrcSize() == 1);
450 Str << "\t" << Opcode << "\t"; 453 Str << "\t" << Opcode << "\t";
451 getDest()->emit(Func); 454 getDest()->emit(Func);
452 Str << ", "; 455 Str << ", ";
453 getSrc(0)->emit(Func); 456 getSrc(0)->emit(Func);
454 Str << "\n"; 457 Str << "\n";
455 } 458 }
459 virtual void emitIAS(const Cfg *Func) const { emit(Func); }
456 virtual void dump(const Cfg *Func) const { 460 virtual void dump(const Cfg *Func) const {
457 Ostream &Str = Func->getContext()->getStrDump(); 461 Ostream &Str = Func->getContext()->getStrDump();
458 dumpDest(Func); 462 dumpDest(Func);
459 Str << " = " << Opcode << "." << getDest()->getType() << " "; 463 Str << " = " << Opcode << "." << getDest()->getType() << " ";
460 dumpSources(Func); 464 dumpSources(Func);
461 } 465 }
462 static bool classof(const Inst *Inst) { return isClassof(Inst, K); } 466 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
463 467
464 private: 468 private:
465 InstX8632Unaryop(Cfg *Func, Variable *Dest, Operand *Src) 469 InstX8632Unaryop(Cfg *Func, Variable *Dest, Operand *Src)
466 : InstX8632(Func, K, 1, Dest) { 470 : InstX8632(Func, K, 1, Dest) {
467 addSource(Src); 471 addSource(Src);
468 } 472 }
469 InstX8632Unaryop(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION; 473 InstX8632Unaryop(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION;
470 InstX8632Unaryop &operator=(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION; 474 InstX8632Unaryop &operator=(const InstX8632Unaryop &) LLVM_DELETED_FUNCTION;
471 virtual ~InstX8632Unaryop() {} 475 virtual ~InstX8632Unaryop() {}
472 static const char *Opcode; 476 static const char *Opcode;
473 }; 477 };
474 478
479 void emitIASVarOperandTyXMM(const Cfg *Func, Type Ty, const Variable *Var,
480 const Operand *Src,
481 const x86::AssemblerX86::TypedXmmEmitters &Emitter);
482
483 template <InstX8632::InstKindX8632 K>
484 class InstX8632UnaryopXmm : public InstX8632 {
485 public:
486 static InstX8632UnaryopXmm *create(Cfg *Func, Variable *Dest, Operand *Src) {
487 return new (Func->allocate<InstX8632UnaryopXmm>())
488 InstX8632UnaryopXmm(Func, Dest, Src);
489 }
490 virtual void emit(const Cfg *Func) const {
491 Ostream &Str = Func->getContext()->getStrEmit();
492 assert(getSrcSize() == 1);
493 Str << "\t" << Opcode << "\t";
494 getDest()->emit(Func);
495 Str << ", ";
496 getSrc(0)->emit(Func);
497 Str << "\n";
498 }
499 virtual void emitIAS(const Cfg *Func) const {
500 Type Ty = getDest()->getType();
501 assert(getSrcSize() == 1);
502 emitIASVarOperandTyXMM(Func, Ty, getDest(), getSrc(0), Emitter);
503 }
504 virtual void dump(const Cfg *Func) const {
505 Ostream &Str = Func->getContext()->getStrDump();
506 dumpDest(Func);
507 Str << " = " << Opcode << "." << getDest()->getType() << " ";
508 dumpSources(Func);
509 }
510 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
511
512 private:
513 InstX8632UnaryopXmm(Cfg *Func, Variable *Dest, Operand *Src)
514 : InstX8632(Func, K, 1, Dest) {
515 addSource(Src);
516 }
517 InstX8632UnaryopXmm(const InstX8632UnaryopXmm &) LLVM_DELETED_FUNCTION;
518 InstX8632UnaryopXmm &
519 operator=(const InstX8632UnaryopXmm &) LLVM_DELETED_FUNCTION;
520 virtual ~InstX8632UnaryopXmm() {}
521 static const char *Opcode;
522 static const x86::AssemblerX86::TypedXmmEmitters Emitter;
523 };
524
475 // See the definition of emitTwoAddress() for a description of 525 // See the definition of emitTwoAddress() for a description of
476 // ShiftHack. 526 // ShiftHack.
477 void emitTwoAddress(const char *Opcode, const Inst *Inst, const Cfg *Func, 527 void emitTwoAddress(const char *Opcode, const Inst *Inst, const Cfg *Func,
478 bool ShiftHack = false); 528 bool ShiftHack = false);
479 529
480 template <InstX8632::InstKindX8632 K, bool ShiftHack = false> 530 template <InstX8632::InstKindX8632 K, bool ShiftHack = false>
481 class InstX8632Binop : public InstX8632 { 531 class InstX8632Binop : public InstX8632 {
482 public: 532 public:
483 // Create an ordinary binary-op instruction like add or sub. 533 // Create an ordinary binary-op instruction like add or sub.
484 static InstX8632Binop *create(Cfg *Func, Variable *Dest, Operand *Source) { 534 static InstX8632Binop *create(Cfg *Func, Variable *Dest, Operand *Source) {
(...skipping 16 matching lines...) Expand all
501 : InstX8632(Func, K, 2, Dest) { 551 : InstX8632(Func, K, 2, Dest) {
502 addSource(Dest); 552 addSource(Dest);
503 addSource(Source); 553 addSource(Source);
504 } 554 }
505 InstX8632Binop(const InstX8632Binop &) LLVM_DELETED_FUNCTION; 555 InstX8632Binop(const InstX8632Binop &) LLVM_DELETED_FUNCTION;
506 InstX8632Binop &operator=(const InstX8632Binop &) LLVM_DELETED_FUNCTION; 556 InstX8632Binop &operator=(const InstX8632Binop &) LLVM_DELETED_FUNCTION;
507 virtual ~InstX8632Binop() {} 557 virtual ~InstX8632Binop() {}
508 static const char *Opcode; 558 static const char *Opcode;
509 }; 559 };
510 560
561 template <InstX8632::InstKindX8632 K, bool NeedsElementType>
562 class InstX8632BinopXmm : public InstX8632 {
563 public:
564 // Create an XMM binary-op instruction like addss or addps.
565 static InstX8632BinopXmm *create(Cfg *Func, Variable *Dest, Operand *Source) {
566 return new (Func->allocate<InstX8632BinopXmm>())
567 InstX8632BinopXmm(Func, Dest, Source);
568 }
569 virtual void emit(const Cfg *Func) const {
570 const bool ShiftHack = false;
571 emitTwoAddress(Opcode, this, Func, ShiftHack);
572 }
573 virtual void emitIAS(const Cfg *Func) const {
574 Type Ty = getDest()->getType();
575 if (NeedsElementType)
576 Ty = typeElementType(Ty);
577 assert(getSrcSize() == 2);
578 emitIASVarOperandTyXMM(Func, Ty, getDest(), getSrc(1), Emitter);
579 }
580 virtual void dump(const Cfg *Func) const {
581 Ostream &Str = Func->getContext()->getStrDump();
582 dumpDest(Func);
583 Str << " = " << Opcode << "." << getDest()->getType() << " ";
584 dumpSources(Func);
585 }
586 static bool classof(const Inst *Inst) { return isClassof(Inst, K); }
587
588 private:
589 InstX8632BinopXmm(Cfg *Func, Variable *Dest, Operand *Source)
590 : InstX8632(Func, K, 2, Dest) {
591 addSource(Dest);
592 addSource(Source);
593 }
594 InstX8632BinopXmm(const InstX8632BinopXmm &) LLVM_DELETED_FUNCTION;
595 InstX8632BinopXmm &operator=(const InstX8632BinopXmm &) LLVM_DELETED_FUNCTION;
596 virtual ~InstX8632BinopXmm() {}
597 static const char *Opcode;
598 static const x86::AssemblerX86::TypedXmmEmitters Emitter;
599 };
600
511 template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 { 601 template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 {
512 public: 602 public:
513 // Create a ternary-op instruction like div or idiv. 603 // Create a ternary-op instruction like div or idiv.
514 static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1, 604 static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1,
515 Operand *Source2) { 605 Operand *Source2) {
516 return new (Func->allocate<InstX8632Ternop>()) 606 return new (Func->allocate<InstX8632Ternop>())
517 InstX8632Ternop(Func, Dest, Source1, Source2); 607 InstX8632Ternop(Func, Dest, Source1, Source2);
518 } 608 }
519 virtual void emit(const Cfg *Func) const { 609 virtual void emit(const Cfg *Func) const {
520 Ostream &Str = Func->getContext()->getStrEmit(); 610 Ostream &Str = Func->getContext()->getStrEmit();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 715
626 static const char *Opcode; 716 static const char *Opcode;
627 }; 717 };
628 718
629 typedef InstX8632Inplaceop<InstX8632::Bswap> InstX8632Bswap; 719 typedef InstX8632Inplaceop<InstX8632::Bswap> InstX8632Bswap;
630 typedef InstX8632Inplaceop<InstX8632::Neg> InstX8632Neg; 720 typedef InstX8632Inplaceop<InstX8632::Neg> InstX8632Neg;
631 typedef InstX8632Unaryop<InstX8632::Bsf> InstX8632Bsf; 721 typedef InstX8632Unaryop<InstX8632::Bsf> InstX8632Bsf;
632 typedef InstX8632Unaryop<InstX8632::Bsr> InstX8632Bsr; 722 typedef InstX8632Unaryop<InstX8632::Bsr> InstX8632Bsr;
633 typedef InstX8632Unaryop<InstX8632::Lea> InstX8632Lea; 723 typedef InstX8632Unaryop<InstX8632::Lea> InstX8632Lea;
634 typedef InstX8632Unaryop<InstX8632::Movd> InstX8632Movd; 724 typedef InstX8632Unaryop<InstX8632::Movd> InstX8632Movd;
635 typedef InstX8632Unaryop<InstX8632::Sqrtss> InstX8632Sqrtss; 725 typedef InstX8632UnaryopXmm<InstX8632::Sqrtss> InstX8632Sqrtss;
636 // Cbwdq instruction - wrapper for cbw, cwd, and cdq 726 // Cbwdq instruction - wrapper for cbw, cwd, and cdq
637 typedef InstX8632Unaryop<InstX8632::Cbwdq> InstX8632Cbwdq; 727 typedef InstX8632Unaryop<InstX8632::Cbwdq> InstX8632Cbwdq;
638 // Move/assignment instruction - wrapper for mov/movss/movsd. 728 // Move/assignment instruction - wrapper for mov/movss/movsd.
639 typedef InstX8632Movlike<InstX8632::Mov> InstX8632Mov; 729 typedef InstX8632Movlike<InstX8632::Mov> InstX8632Mov;
640 // Move packed - copy 128 bit values between XMM registers, or mem128 730 // Move packed - copy 128 bit values between XMM registers, or mem128
641 // and XMM registers. 731 // and XMM registers.
642 typedef InstX8632Movlike<InstX8632::Movp> InstX8632Movp; 732 typedef InstX8632Movlike<InstX8632::Movp> InstX8632Movp;
643 // Movq - copy between XMM registers, or mem64 and XMM registers. 733 // Movq - copy between XMM registers, or mem64 and XMM registers.
644 typedef InstX8632Movlike<InstX8632::Movq> InstX8632Movq; 734 typedef InstX8632Movlike<InstX8632::Movq> InstX8632Movq;
645 typedef InstX8632Binop<InstX8632::Add> InstX8632Add; 735 typedef InstX8632Binop<InstX8632::Add> InstX8632Add;
646 typedef InstX8632Binop<InstX8632::Addps> InstX8632Addps; 736 typedef InstX8632BinopXmm<InstX8632::Addps, true> InstX8632Addps;
647 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc; 737 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc;
648 typedef InstX8632Binop<InstX8632::Addss> InstX8632Addss; 738 typedef InstX8632BinopXmm<InstX8632::Addss, false> InstX8632Addss;
649 typedef InstX8632Binop<InstX8632::Padd> InstX8632Padd; 739 typedef InstX8632BinopXmm<InstX8632::Padd, true> InstX8632Padd;
650 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub; 740 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub;
651 typedef InstX8632Binop<InstX8632::Subps> InstX8632Subps; 741 typedef InstX8632BinopXmm<InstX8632::Subps, true> InstX8632Subps;
652 typedef InstX8632Binop<InstX8632::Subss> InstX8632Subss; 742 typedef InstX8632BinopXmm<InstX8632::Subss, false> InstX8632Subss;
653 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb; 743 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb;
654 typedef InstX8632Binop<InstX8632::Psub> InstX8632Psub; 744 typedef InstX8632BinopXmm<InstX8632::Psub, true> InstX8632Psub;
655 typedef InstX8632Binop<InstX8632::And> InstX8632And; 745 typedef InstX8632Binop<InstX8632::And> InstX8632And;
656 typedef InstX8632Binop<InstX8632::Pand> InstX8632Pand; 746 typedef InstX8632BinopXmm<InstX8632::Pand, false> InstX8632Pand;
657 typedef InstX8632Binop<InstX8632::Pandn> InstX8632Pandn; 747 typedef InstX8632BinopXmm<InstX8632::Pandn, false> InstX8632Pandn;
658 typedef InstX8632Binop<InstX8632::Or> InstX8632Or; 748 typedef InstX8632Binop<InstX8632::Or> InstX8632Or;
659 typedef InstX8632Binop<InstX8632::Por> InstX8632Por; 749 typedef InstX8632BinopXmm<InstX8632::Por, false> InstX8632Por;
660 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor; 750 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor;
661 typedef InstX8632Binop<InstX8632::Pxor> InstX8632Pxor; 751 typedef InstX8632BinopXmm<InstX8632::Pxor, false> InstX8632Pxor;
662 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul; 752 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul;
663 typedef InstX8632Binop<InstX8632::Mulps> InstX8632Mulps; 753 typedef InstX8632BinopXmm<InstX8632::Mulps, true> InstX8632Mulps;
664 typedef InstX8632Binop<InstX8632::Mulss> InstX8632Mulss; 754 typedef InstX8632BinopXmm<InstX8632::Mulss, false> InstX8632Mulss;
665 typedef InstX8632Binop<InstX8632::Pmull> InstX8632Pmull; 755 typedef InstX8632Binop<InstX8632::Pmull> InstX8632Pmull;
666 typedef InstX8632Binop<InstX8632::Pmuludq> InstX8632Pmuludq; 756 typedef InstX8632BinopXmm<InstX8632::Pmuludq, false> InstX8632Pmuludq;
667 typedef InstX8632Binop<InstX8632::Divps> InstX8632Divps; 757 typedef InstX8632BinopXmm<InstX8632::Divps, true> InstX8632Divps;
668 typedef InstX8632Binop<InstX8632::Divss> InstX8632Divss; 758 typedef InstX8632BinopXmm<InstX8632::Divss, false> InstX8632Divss;
669 typedef InstX8632Binop<InstX8632::Rol, true> InstX8632Rol; 759 typedef InstX8632Binop<InstX8632::Rol, true> InstX8632Rol;
670 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl; 760 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl;
671 typedef InstX8632Binop<InstX8632::Psll> InstX8632Psll; 761 typedef InstX8632Binop<InstX8632::Psll> InstX8632Psll;
672 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr; 762 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr;
673 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar; 763 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar;
674 typedef InstX8632Binop<InstX8632::Psra> InstX8632Psra; 764 typedef InstX8632Binop<InstX8632::Psra> InstX8632Psra;
675 typedef InstX8632Binop<InstX8632::Pcmpeq> InstX8632Pcmpeq; 765 typedef InstX8632Binop<InstX8632::Pcmpeq> InstX8632Pcmpeq;
676 typedef InstX8632Binop<InstX8632::Pcmpgt> InstX8632Pcmpgt; 766 typedef InstX8632Binop<InstX8632::Pcmpgt> InstX8632Pcmpgt;
677 // TODO: movss is only a binary operation when the source and dest 767 // TODO: movss is only a binary operation when the source and dest
678 // operands are both registers. In other cases, it behaves like a copy 768 // operands are both registers. In other cases, it behaves like a copy
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 // Cmpps instruction - compare packed singled-precision floating point 886 // Cmpps instruction - compare packed singled-precision floating point
797 // values 887 // values
798 class InstX8632Cmpps : public InstX8632 { 888 class InstX8632Cmpps : public InstX8632 {
799 public: 889 public:
800 static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source, 890 static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source,
801 CondX86::CmppsCond Condition) { 891 CondX86::CmppsCond Condition) {
802 return new (Func->allocate<InstX8632Cmpps>()) 892 return new (Func->allocate<InstX8632Cmpps>())
803 InstX8632Cmpps(Func, Dest, Source, Condition); 893 InstX8632Cmpps(Func, Dest, Source, Condition);
804 } 894 }
805 virtual void emit(const Cfg *Func) const; 895 virtual void emit(const Cfg *Func) const;
896 virtual void emitIAS(const Cfg *Func) const;
806 virtual void dump(const Cfg *Func) const; 897 virtual void dump(const Cfg *Func) const;
807 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpps); } 898 static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpps); }
808 899
809 private: 900 private:
810 InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source, 901 InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source,
811 CondX86::CmppsCond Cond); 902 CondX86::CmppsCond Cond);
812 InstX8632Cmpps(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; 903 InstX8632Cmpps(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION;
813 InstX8632Cmpps &operator=(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION; 904 InstX8632Cmpps &operator=(const InstX8632Cmpps &) LLVM_DELETED_FUNCTION;
814 virtual ~InstX8632Cmpps() {} 905 virtual ~InstX8632Cmpps() {}
815 906
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 }; 1000 };
910 1001
911 // ucomiss/ucomisd - floating-point compare instruction. 1002 // ucomiss/ucomisd - floating-point compare instruction.
912 class InstX8632Ucomiss : public InstX8632 { 1003 class InstX8632Ucomiss : public InstX8632 {
913 public: 1004 public:
914 static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) { 1005 static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) {
915 return new (Func->allocate<InstX8632Ucomiss>()) 1006 return new (Func->allocate<InstX8632Ucomiss>())
916 InstX8632Ucomiss(Func, Src1, Src2); 1007 InstX8632Ucomiss(Func, Src1, Src2);
917 } 1008 }
918 virtual void emit(const Cfg *Func) const; 1009 virtual void emit(const Cfg *Func) const;
1010 virtual void emitIAS(const Cfg *Func) const;
919 virtual void dump(const Cfg *Func) const; 1011 virtual void dump(const Cfg *Func) const;
920 static bool classof(const Inst *Inst) { return isClassof(Inst, Ucomiss); } 1012 static bool classof(const Inst *Inst) { return isClassof(Inst, Ucomiss); }
921 1013
922 private: 1014 private:
923 InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2); 1015 InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2);
924 InstX8632Ucomiss(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; 1016 InstX8632Ucomiss(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION;
925 InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION; 1017 InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) LLVM_DELETED_FUNCTION;
926 virtual ~InstX8632Ucomiss() {} 1018 virtual ~InstX8632Ucomiss() {}
927 }; 1019 };
928 1020
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 // Nop instructions of varying length 1168 // Nop instructions of varying length
1077 class InstX8632Nop : public InstX8632 { 1169 class InstX8632Nop : public InstX8632 {
1078 public: 1170 public:
1079 // TODO: Replace with enum. 1171 // TODO: Replace with enum.
1080 typedef unsigned NopVariant; 1172 typedef unsigned NopVariant;
1081 1173
1082 static InstX8632Nop *create(Cfg *Func, NopVariant Variant) { 1174 static InstX8632Nop *create(Cfg *Func, NopVariant Variant) {
1083 return new (Func->allocate<InstX8632Nop>()) InstX8632Nop(Func, Variant); 1175 return new (Func->allocate<InstX8632Nop>()) InstX8632Nop(Func, Variant);
1084 } 1176 }
1085 virtual void emit(const Cfg *Func) const; 1177 virtual void emit(const Cfg *Func) const;
1178 virtual void emitIAS(const Cfg *Func) const;
1086 virtual void dump(const Cfg *Func) const; 1179 virtual void dump(const Cfg *Func) const;
1087 static bool classof(const Inst *Inst) { return isClassof(Inst, Nop); } 1180 static bool classof(const Inst *Inst) { return isClassof(Inst, Nop); }
1088 1181
1089 private: 1182 private:
1090 InstX8632Nop(Cfg *Func, SizeT Length); 1183 InstX8632Nop(Cfg *Func, SizeT Length);
1091 InstX8632Nop(const InstX8632Nop &) LLVM_DELETED_FUNCTION; 1184 InstX8632Nop(const InstX8632Nop &) LLVM_DELETED_FUNCTION;
1092 InstX8632Nop &operator=(const InstX8632Nop &) LLVM_DELETED_FUNCTION; 1185 InstX8632Nop &operator=(const InstX8632Nop &) LLVM_DELETED_FUNCTION;
1093 virtual ~InstX8632Nop() {} 1186 virtual ~InstX8632Nop() {}
1094 1187
1095 NopVariant Variant; 1188 NopVariant Variant;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 InstX8632Fstp &operator=(const InstX8632Fstp &) LLVM_DELETED_FUNCTION; 1221 InstX8632Fstp &operator=(const InstX8632Fstp &) LLVM_DELETED_FUNCTION;
1129 virtual ~InstX8632Fstp() {} 1222 virtual ~InstX8632Fstp() {}
1130 }; 1223 };
1131 1224
1132 class InstX8632Pop : public InstX8632 { 1225 class InstX8632Pop : public InstX8632 {
1133 public: 1226 public:
1134 static InstX8632Pop *create(Cfg *Func, Variable *Dest) { 1227 static InstX8632Pop *create(Cfg *Func, Variable *Dest) {
1135 return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest); 1228 return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest);
1136 } 1229 }
1137 virtual void emit(const Cfg *Func) const; 1230 virtual void emit(const Cfg *Func) const;
1231 virtual void emitIAS(const Cfg *Func) const;
1138 virtual void dump(const Cfg *Func) const; 1232 virtual void dump(const Cfg *Func) const;
1139 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); } 1233 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); }
1140 1234
1141 private: 1235 private:
1142 InstX8632Pop(Cfg *Func, Variable *Dest); 1236 InstX8632Pop(Cfg *Func, Variable *Dest);
1143 InstX8632Pop(const InstX8632Pop &) LLVM_DELETED_FUNCTION; 1237 InstX8632Pop(const InstX8632Pop &) LLVM_DELETED_FUNCTION;
1144 InstX8632Pop &operator=(const InstX8632Pop &) LLVM_DELETED_FUNCTION; 1238 InstX8632Pop &operator=(const InstX8632Pop &) LLVM_DELETED_FUNCTION;
1145 virtual ~InstX8632Pop() {} 1239 virtual ~InstX8632Pop() {}
1146 }; 1240 };
1147 1241
(...skipping 19 matching lines...) Expand all
1167 // Ret instruction. Currently only supports the "ret" version that 1261 // Ret instruction. Currently only supports the "ret" version that
1168 // does not pop arguments. This instruction takes a Source operand 1262 // does not pop arguments. This instruction takes a Source operand
1169 // (for non-void returning functions) for liveness analysis, though 1263 // (for non-void returning functions) for liveness analysis, though
1170 // a FakeUse before the ret would do just as well. 1264 // a FakeUse before the ret would do just as well.
1171 class InstX8632Ret : public InstX8632 { 1265 class InstX8632Ret : public InstX8632 {
1172 public: 1266 public:
1173 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { 1267 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) {
1174 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); 1268 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source);
1175 } 1269 }
1176 virtual void emit(const Cfg *Func) const; 1270 virtual void emit(const Cfg *Func) const;
1271 virtual void emitIAS(const Cfg *Func) const;
1177 virtual void dump(const Cfg *Func) const; 1272 virtual void dump(const Cfg *Func) const;
1178 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } 1273 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); }
1179 1274
1180 private: 1275 private:
1181 InstX8632Ret(Cfg *Func, Variable *Source); 1276 InstX8632Ret(Cfg *Func, Variable *Source);
1182 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION; 1277 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION;
1183 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION; 1278 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION;
1184 virtual ~InstX8632Ret() {} 1279 virtual ~InstX8632Ret() {}
1185 }; 1280 };
1186 1281
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const; 1349 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const;
1255 template <> void InstX8632Psll::emit(const Cfg *Func) const; 1350 template <> void InstX8632Psll::emit(const Cfg *Func) const;
1256 template <> void InstX8632Psra::emit(const Cfg *Func) const; 1351 template <> void InstX8632Psra::emit(const Cfg *Func) const;
1257 template <> void InstX8632Psub::emit(const Cfg *Func) const; 1352 template <> void InstX8632Psub::emit(const Cfg *Func) const;
1258 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const; 1353 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const;
1259 template <> void InstX8632Subss::emit(const Cfg *Func) const; 1354 template <> void InstX8632Subss::emit(const Cfg *Func) const;
1260 1355
1261 } // end of namespace Ice 1356 } // end of namespace Ice
1262 1357
1263 #endif // SUBZERO_SRC_ICEINSTX8632_H 1358 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('j') | src/IceInstX8632.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698