OLD | NEW |
1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===// | 1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 llvm::report_fatal_error("Control flow should never have reached here."); | 584 llvm::report_fatal_error("Control flow should never have reached here."); |
585 } | 585 } |
586 case Inst::Cast: { | 586 case Inst::Cast: { |
587 Variable *Dest = Instr->getDest(); | 587 Variable *Dest = Instr->getDest(); |
588 Operand *Src0 = Instr->getSrc(0); | 588 Operand *Src0 = Instr->getSrc(0); |
589 const Type DestTy = Dest->getType(); | 589 const Type DestTy = Dest->getType(); |
590 auto *CastInstr = llvm::cast<InstCast>(Instr); | 590 auto *CastInstr = llvm::cast<InstCast>(Instr); |
591 const InstCast::OpKind CastKind = CastInstr->getCastKind(); | 591 const InstCast::OpKind CastKind = CastInstr->getCastKind(); |
592 | 592 |
593 if (isVectorType(DestTy)) { | 593 if (isVectorType(DestTy)) { |
594 scalarizeUnaryInstruction( | 594 scalarizeInstruction( |
595 Dest, Src0, [this, CastKind](Variable *Dest, Variable *Src) { | 595 Dest, [this, CastKind](Variable *Dest, Variable *Src) { |
596 return Context.insert<InstCast>(CastKind, Dest, Src); | 596 return Context.insert<InstCast>(CastKind, Dest, Src); |
597 }); | 597 }, Src0); |
598 CastInstr->setDeleted(); | 598 CastInstr->setDeleted(); |
599 return; | 599 return; |
600 } | 600 } |
601 | 601 |
602 switch (CastKind) { | 602 switch (CastKind) { |
603 default: | 603 default: |
604 return; | 604 return; |
605 case InstCast::Fptosi: | 605 case InstCast::Fptosi: |
606 case InstCast::Fptoui: { | 606 case InstCast::Fptoui: { |
607 if (DestTy != IceType_i64) { | 607 if (DestTy != IceType_i64) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 } | 745 } |
746 llvm::report_fatal_error("Control flow should never have reached here."); | 746 llvm::report_fatal_error("Control flow should never have reached here."); |
747 } | 747 } |
748 case Inst::Icmp: { | 748 case Inst::Icmp: { |
749 Variable *Dest = Instr->getDest(); | 749 Variable *Dest = Instr->getDest(); |
750 const Type DestTy = Dest->getType(); | 750 const Type DestTy = Dest->getType(); |
751 if (isVectorType(DestTy)) { | 751 if (isVectorType(DestTy)) { |
752 auto *CmpInstr = llvm::cast<InstIcmp>(Instr); | 752 auto *CmpInstr = llvm::cast<InstIcmp>(Instr); |
753 const auto Condition = CmpInstr->getCondition(); | 753 const auto Condition = CmpInstr->getCondition(); |
754 scalarizeInstruction( | 754 scalarizeInstruction( |
755 Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), | 755 Dest, |
756 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { | 756 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
757 return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1); | 757 return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1); |
758 }); | 758 }, |
| 759 CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
759 CmpInstr->setDeleted(); | 760 CmpInstr->setDeleted(); |
760 } | 761 } |
761 return; | 762 return; |
762 } | 763 } |
763 case Inst::Fcmp: { | 764 case Inst::Fcmp: { |
764 Variable *Dest = Instr->getDest(); | 765 Variable *Dest = Instr->getDest(); |
765 const Type DestTy = Dest->getType(); | 766 const Type DestTy = Dest->getType(); |
766 if (isVectorType(DestTy)) { | 767 if (isVectorType(DestTy)) { |
767 auto *CmpInstr = llvm::cast<InstFcmp>(Instr); | 768 auto *CmpInstr = llvm::cast<InstFcmp>(Instr); |
768 const auto Condition = CmpInstr->getCondition(); | 769 const auto Condition = CmpInstr->getCondition(); |
769 scalarizeInstruction( | 770 scalarizeInstruction( |
770 Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), | 771 Dest, |
771 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { | 772 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
772 return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1); | 773 return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1); |
773 }); | 774 }, |
| 775 CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
774 CmpInstr->setDeleted(); | 776 CmpInstr->setDeleted(); |
775 } | 777 } |
776 return; | 778 return; |
777 } | 779 } |
| 780 case Inst::Select: { |
| 781 Variable *Dest = Instr->getDest(); |
| 782 const auto DestTy = Dest->getType(); |
| 783 if (isVectorType(DestTy)) { |
| 784 auto *SelectInstr = llvm::cast<InstSelect>(Instr); |
| 785 scalarizeInstruction(Dest, |
| 786 [this](Variable *Dest, Variable *Src0, |
| 787 Variable *Src1, Variable *Src2) { |
| 788 return Context.insert<InstSelect>(Dest, Src0, Src1, |
| 789 Src2); |
| 790 }, |
| 791 llvm::cast<Variable>(SelectInstr->getSrc(0)), |
| 792 llvm::cast<Variable>(SelectInstr->getSrc(1)), |
| 793 llvm::cast<Variable>(SelectInstr->getSrc(2))); |
| 794 SelectInstr->setDeleted(); |
| 795 } |
| 796 return; |
| 797 } |
778 } | 798 } |
779 } | 799 } |
780 | 800 |
781 void TargetARM32::findMaxStackOutArgsSize() { | 801 void TargetARM32::findMaxStackOutArgsSize() { |
782 // MinNeededOutArgsBytes should be updated if the Target ever creates a | 802 // MinNeededOutArgsBytes should be updated if the Target ever creates a |
783 // high-level InstCall that requires more stack bytes. | 803 // high-level InstCall that requires more stack bytes. |
784 constexpr size_t MinNeededOutArgsBytes = 0; | 804 constexpr size_t MinNeededOutArgsBytes = 0; |
785 MaxOutArgsSizeBytes = MinNeededOutArgsBytes; | 805 MaxOutArgsSizeBytes = MinNeededOutArgsBytes; |
786 for (CfgNode *Node : Func->getNodes()) { | 806 for (CfgNode *Node : Func->getNodes()) { |
787 Context.init(Node); | 807 Context.init(Node); |
(...skipping 6082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6870 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; | 6890 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; |
6871 } | 6891 } |
6872 | 6892 |
6873 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; | 6893 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; |
6874 llvm::SmallBitVector | 6894 llvm::SmallBitVector |
6875 TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM]; | 6895 TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM]; |
6876 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; | 6896 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; |
6877 | 6897 |
6878 } // end of namespace ARM32 | 6898 } // end of namespace ARM32 |
6879 } // end of namespace Ice | 6899 } // end of namespace Ice |
OLD | NEW |