| 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 llvm::report_fatal_error("Control flow should never have reached here."); | 585 llvm::report_fatal_error("Control flow should never have reached here."); |
| 586 } | 586 } |
| 587 case Inst::Cast: { | 587 case Inst::Cast: { |
| 588 Variable *Dest = Instr->getDest(); | 588 Variable *Dest = Instr->getDest(); |
| 589 Operand *Src0 = Instr->getSrc(0); | 589 Operand *Src0 = Instr->getSrc(0); |
| 590 const Type DestTy = Dest->getType(); | 590 const Type DestTy = Dest->getType(); |
| 591 auto *CastInstr = llvm::cast<InstCast>(Instr); | 591 auto *CastInstr = llvm::cast<InstCast>(Instr); |
| 592 const InstCast::OpKind CastKind = CastInstr->getCastKind(); | 592 const InstCast::OpKind CastKind = CastInstr->getCastKind(); |
| 593 | 593 |
| 594 if (isVectorType(DestTy)) { | 594 if (isVectorType(DestTy)) { |
| 595 scalarizeUnaryInstruction( | 595 scalarizeInstruction( |
| 596 Dest, Src0, [this, CastKind](Variable *Dest, Variable *Src) { | 596 Dest, [this, CastKind](Variable *Dest, Variable *Src) { |
| 597 return Context.insert<InstCast>(CastKind, Dest, Src); | 597 return Context.insert<InstCast>(CastKind, Dest, Src); |
| 598 }); | 598 }, Src0); |
| 599 CastInstr->setDeleted(); | 599 CastInstr->setDeleted(); |
| 600 return; | 600 return; |
| 601 } | 601 } |
| 602 | 602 |
| 603 switch (CastKind) { | 603 switch (CastKind) { |
| 604 default: | 604 default: |
| 605 return; | 605 return; |
| 606 case InstCast::Fptosi: | 606 case InstCast::Fptosi: |
| 607 case InstCast::Fptoui: { | 607 case InstCast::Fptoui: { |
| 608 if (DestTy != IceType_i64) { | 608 if (DestTy != IceType_i64) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 } | 746 } |
| 747 llvm::report_fatal_error("Control flow should never have reached here."); | 747 llvm::report_fatal_error("Control flow should never have reached here."); |
| 748 } | 748 } |
| 749 case Inst::Icmp: { | 749 case Inst::Icmp: { |
| 750 Variable *Dest = Instr->getDest(); | 750 Variable *Dest = Instr->getDest(); |
| 751 const Type DestTy = Dest->getType(); | 751 const Type DestTy = Dest->getType(); |
| 752 if (isVectorType(DestTy)) { | 752 if (isVectorType(DestTy)) { |
| 753 auto *CmpInstr = llvm::cast<InstIcmp>(Instr); | 753 auto *CmpInstr = llvm::cast<InstIcmp>(Instr); |
| 754 const auto Condition = CmpInstr->getCondition(); | 754 const auto Condition = CmpInstr->getCondition(); |
| 755 scalarizeInstruction( | 755 scalarizeInstruction( |
| 756 Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), | 756 Dest, |
| 757 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { | 757 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
| 758 return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1); | 758 return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1); |
| 759 }); | 759 }, |
| 760 CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
| 760 CmpInstr->setDeleted(); | 761 CmpInstr->setDeleted(); |
| 761 } | 762 } |
| 762 return; | 763 return; |
| 763 } | 764 } |
| 764 case Inst::Fcmp: { | 765 case Inst::Fcmp: { |
| 765 Variable *Dest = Instr->getDest(); | 766 Variable *Dest = Instr->getDest(); |
| 766 const Type DestTy = Dest->getType(); | 767 const Type DestTy = Dest->getType(); |
| 767 if (isVectorType(DestTy)) { | 768 if (isVectorType(DestTy)) { |
| 768 auto *CmpInstr = llvm::cast<InstFcmp>(Instr); | 769 auto *CmpInstr = llvm::cast<InstFcmp>(Instr); |
| 769 const auto Condition = CmpInstr->getCondition(); | 770 const auto Condition = CmpInstr->getCondition(); |
| 770 scalarizeInstruction( | 771 scalarizeInstruction( |
| 771 Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), | 772 Dest, |
| 772 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { | 773 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
| 773 return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1); | 774 return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1); |
| 774 }); | 775 }, |
| 776 CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
| 775 CmpInstr->setDeleted(); | 777 CmpInstr->setDeleted(); |
| 776 } | 778 } |
| 777 return; | 779 return; |
| 778 } | 780 } |
| 781 case Inst::Select: { |
| 782 Variable *Dest = Instr->getDest(); |
| 783 const auto DestTy = Dest->getType(); |
| 784 if (isVectorType(DestTy)) { |
| 785 auto *SelectInstr = llvm::cast<InstSelect>(Instr); |
| 786 scalarizeInstruction(Dest, |
| 787 [this](Variable *Dest, Variable *Src0, |
| 788 Variable *Src1, Variable *Src2) { |
| 789 return Context.insert<InstSelect>(Dest, Src0, Src1, |
| 790 Src2); |
| 791 }, |
| 792 llvm::cast<Variable>(SelectInstr->getSrc(0)), |
| 793 llvm::cast<Variable>(SelectInstr->getSrc(1)), |
| 794 llvm::cast<Variable>(SelectInstr->getSrc(2))); |
| 795 SelectInstr->setDeleted(); |
| 796 } |
| 797 return; |
| 798 } |
| 779 } | 799 } |
| 780 } | 800 } |
| 781 | 801 |
| 782 void TargetARM32::findMaxStackOutArgsSize() { | 802 void TargetARM32::findMaxStackOutArgsSize() { |
| 783 // MinNeededOutArgsBytes should be updated if the Target ever creates a | 803 // MinNeededOutArgsBytes should be updated if the Target ever creates a |
| 784 // high-level InstCall that requires more stack bytes. | 804 // high-level InstCall that requires more stack bytes. |
| 785 constexpr size_t MinNeededOutArgsBytes = 0; | 805 constexpr size_t MinNeededOutArgsBytes = 0; |
| 786 MaxOutArgsSizeBytes = MinNeededOutArgsBytes; | 806 MaxOutArgsSizeBytes = MinNeededOutArgsBytes; |
| 787 for (CfgNode *Node : Func->getNodes()) { | 807 for (CfgNode *Node : Func->getNodes()) { |
| 788 Context.init(Node); | 808 Context.init(Node); |
| (...skipping 5989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6778 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; | 6798 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; |
| 6779 } | 6799 } |
| 6780 | 6800 |
| 6781 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; | 6801 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; |
| 6782 llvm::SmallBitVector | 6802 llvm::SmallBitVector |
| 6783 TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM]; | 6803 TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM]; |
| 6784 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; | 6804 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; |
| 6785 | 6805 |
| 6786 } // end of namespace ARM32 | 6806 } // end of namespace ARM32 |
| 6787 } // end of namespace Ice | 6807 } // end of namespace Ice |
| OLD | NEW |