| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 llvm::report_fatal_error("Control flow should never have reached here."); | 576 llvm::report_fatal_error("Control flow should never have reached here."); |
| 577 } | 577 } |
| 578 case Inst::Cast: { | 578 case Inst::Cast: { |
| 579 Variable *Dest = Instr->getDest(); | 579 Variable *Dest = Instr->getDest(); |
| 580 Operand *Src0 = Instr->getSrc(0); | 580 Operand *Src0 = Instr->getSrc(0); |
| 581 const Type DestTy = Dest->getType(); | 581 const Type DestTy = Dest->getType(); |
| 582 auto *CastInstr = llvm::cast<InstCast>(Instr); | 582 auto *CastInstr = llvm::cast<InstCast>(Instr); |
| 583 const InstCast::OpKind CastKind = CastInstr->getCastKind(); | 583 const InstCast::OpKind CastKind = CastInstr->getCastKind(); |
| 584 | 584 |
| 585 if (isVectorType(DestTy)) { | 585 if (isVectorType(DestTy)) { |
| 586 scalarizeUnaryInstruction( | 586 scalarizeInstruction( |
| 587 Dest, Src0, [this, CastKind](Variable *Dest, Variable *Src) { | 587 Dest, [this, CastKind](Variable *Dest, Variable *Src) { |
| 588 return Context.insert<InstCast>(CastKind, Dest, Src); | 588 return Context.insert<InstCast>(CastKind, Dest, Src); |
| 589 }); | 589 }, Src0); |
| 590 CastInstr->setDeleted(); | 590 CastInstr->setDeleted(); |
| 591 return; | 591 return; |
| 592 } | 592 } |
| 593 | 593 |
| 594 switch (CastKind) { | 594 switch (CastKind) { |
| 595 default: | 595 default: |
| 596 return; | 596 return; |
| 597 case InstCast::Fptosi: | 597 case InstCast::Fptosi: |
| 598 case InstCast::Fptoui: { | 598 case InstCast::Fptoui: { |
| 599 if (DestTy != IceType_i64) { | 599 if (DestTy != IceType_i64) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 } | 735 } |
| 736 llvm::report_fatal_error("Control flow should never have reached here."); | 736 llvm::report_fatal_error("Control flow should never have reached here."); |
| 737 } | 737 } |
| 738 case Inst::Icmp: { | 738 case Inst::Icmp: { |
| 739 Variable *Dest = Instr->getDest(); | 739 Variable *Dest = Instr->getDest(); |
| 740 const Type DestTy = Dest->getType(); | 740 const Type DestTy = Dest->getType(); |
| 741 if (isVectorType(DestTy)) { | 741 if (isVectorType(DestTy)) { |
| 742 auto *CmpInstr = llvm::cast<InstIcmp>(Instr); | 742 auto *CmpInstr = llvm::cast<InstIcmp>(Instr); |
| 743 const auto Condition = CmpInstr->getCondition(); | 743 const auto Condition = CmpInstr->getCondition(); |
| 744 scalarizeInstruction( | 744 scalarizeInstruction( |
| 745 Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), | 745 Dest, |
| 746 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { | 746 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
| 747 return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1); | 747 return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1); |
| 748 }); | 748 }, |
| 749 CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
| 749 CmpInstr->setDeleted(); | 750 CmpInstr->setDeleted(); |
| 750 } | 751 } |
| 751 return; | 752 return; |
| 752 } | 753 } |
| 753 case Inst::Fcmp: { | 754 case Inst::Fcmp: { |
| 754 Variable *Dest = Instr->getDest(); | 755 Variable *Dest = Instr->getDest(); |
| 755 const Type DestTy = Dest->getType(); | 756 const Type DestTy = Dest->getType(); |
| 756 if (isVectorType(DestTy)) { | 757 if (isVectorType(DestTy)) { |
| 757 auto *CmpInstr = llvm::cast<InstFcmp>(Instr); | 758 auto *CmpInstr = llvm::cast<InstFcmp>(Instr); |
| 758 const auto Condition = CmpInstr->getCondition(); | 759 const auto Condition = CmpInstr->getCondition(); |
| 759 scalarizeInstruction( | 760 scalarizeInstruction( |
| 760 Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), | 761 Dest, |
| 761 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { | 762 [this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
| 762 return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1); | 763 return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1); |
| 763 }); | 764 }, |
| 765 CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
| 764 CmpInstr->setDeleted(); | 766 CmpInstr->setDeleted(); |
| 765 } | 767 } |
| 766 return; | 768 return; |
| 767 } | 769 } |
| 770 case Inst::Select: { |
| 771 Variable *Dest = Instr->getDest(); |
| 772 const auto DestTy = Dest->getType(); |
| 773 if (isVectorType(DestTy)) { |
| 774 auto *SelectInstr = llvm::cast<InstSelect>(Instr); |
| 775 scalarizeInstruction(Dest, |
| 776 [this](Variable *Dest, Variable *Src0, |
| 777 Variable *Src1, Variable *Src2) { |
| 778 return Context.insert<InstSelect>(Dest, Src0, Src1, |
| 779 Src2); |
| 780 }, |
| 781 SelectInstr->getSrc(0), SelectInstr->getSrc(1), |
| 782 SelectInstr->getSrc(2)); |
| 783 SelectInstr->setDeleted(); |
| 784 } |
| 785 return; |
| 786 } |
| 768 } | 787 } |
| 769 } | 788 } |
| 770 | 789 |
| 771 void TargetARM32::findMaxStackOutArgsSize() { | 790 void TargetARM32::findMaxStackOutArgsSize() { |
| 772 // MinNeededOutArgsBytes should be updated if the Target ever creates a | 791 // MinNeededOutArgsBytes should be updated if the Target ever creates a |
| 773 // high-level InstCall that requires more stack bytes. | 792 // high-level InstCall that requires more stack bytes. |
| 774 constexpr size_t MinNeededOutArgsBytes = 0; | 793 constexpr size_t MinNeededOutArgsBytes = 0; |
| 775 MaxOutArgsSizeBytes = MinNeededOutArgsBytes; | 794 MaxOutArgsSizeBytes = MinNeededOutArgsBytes; |
| 776 for (CfgNode *Node : Func->getNodes()) { | 795 for (CfgNode *Node : Func->getNodes()) { |
| 777 Context.init(Node); | 796 Context.init(Node); |
| (...skipping 5845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6623 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; | 6642 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; |
| 6624 } | 6643 } |
| 6625 | 6644 |
| 6626 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; | 6645 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; |
| 6627 llvm::SmallBitVector | 6646 llvm::SmallBitVector |
| 6628 TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM]; | 6647 TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM]; |
| 6629 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; | 6648 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; |
| 6630 | 6649 |
| 6631 } // end of namespace ARM32 | 6650 } // end of namespace ARM32 |
| 6632 } // end of namespace Ice | 6651 } // end of namespace Ice |
| OLD | NEW |