| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 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 // This file implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 ++I) { | 548 ++I) { |
| 549 Variable *Arg = Args[I]; | 549 Variable *Arg = Args[I]; |
| 550 Type Ty = Arg->getType(); | 550 Type Ty = Arg->getType(); |
| 551 if (!isVectorType(Ty)) | 551 if (!isVectorType(Ty)) |
| 552 continue; | 552 continue; |
| 553 // Replace Arg in the argument list with the home register. Then | 553 // Replace Arg in the argument list with the home register. Then |
| 554 // generate an instruction in the prolog to copy the home register | 554 // generate an instruction in the prolog to copy the home register |
| 555 // to the assigned location of Arg. | 555 // to the assigned location of Arg. |
| 556 int32_t RegNum = RegX8632::Reg_xmm0 + NumXmmArgs; | 556 int32_t RegNum = RegX8632::Reg_xmm0 + NumXmmArgs; |
| 557 ++NumXmmArgs; | 557 ++NumXmmArgs; |
| 558 IceString Name = "home_reg:" + Arg->getName(); | 558 Variable *RegisterArg = Func->makeVariable(Ty); |
| 559 Variable *RegisterArg = Func->makeVariable(Ty, Name); | 559 if (ALLOW_DUMP) |
| 560 RegisterArg->setName(Func, "home_reg:" + Arg->getName(Func)); |
| 560 RegisterArg->setRegNum(RegNum); | 561 RegisterArg->setRegNum(RegNum); |
| 561 RegisterArg->setIsArg(); | 562 RegisterArg->setIsArg(); |
| 562 Arg->setIsArg(false); | 563 Arg->setIsArg(false); |
| 563 | 564 |
| 564 Args[I] = RegisterArg; | 565 Args[I] = RegisterArg; |
| 565 Context.insert(InstAssign::create(Func, Arg, RegisterArg)); | 566 Context.insert(InstAssign::create(Func, Arg, RegisterArg)); |
| 566 } | 567 } |
| 567 } | 568 } |
| 568 | 569 |
| 569 void TargetX8632::sortByAlignment(VarList &Dest, const VarList &Source) const { | 570 void TargetX8632::sortByAlignment(VarList &Dest, const VarList &Source) const { |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 case IceType_f64: | 1044 case IceType_f64: |
| 1044 break; | 1045 break; |
| 1045 } | 1046 } |
| 1046 Variable *Lo = Var->getLo(); | 1047 Variable *Lo = Var->getLo(); |
| 1047 Variable *Hi = Var->getHi(); | 1048 Variable *Hi = Var->getHi(); |
| 1048 if (Lo) { | 1049 if (Lo) { |
| 1049 assert(Hi); | 1050 assert(Hi); |
| 1050 return; | 1051 return; |
| 1051 } | 1052 } |
| 1052 assert(Hi == NULL); | 1053 assert(Hi == NULL); |
| 1053 Lo = Func->makeVariable(IceType_i32, Var->getName() + "__lo"); | 1054 Lo = Func->makeVariable(IceType_i32); |
| 1054 Hi = Func->makeVariable(IceType_i32, Var->getName() + "__hi"); | 1055 Hi = Func->makeVariable(IceType_i32); |
| 1056 if (ALLOW_DUMP) { |
| 1057 Lo->setName(Func, Var->getName(Func) + "__lo"); |
| 1058 Hi->setName(Func, Var->getName(Func) + "__hi"); |
| 1059 } |
| 1055 Var->setLoHi(Lo, Hi); | 1060 Var->setLoHi(Lo, Hi); |
| 1056 if (Var->getIsArg()) { | 1061 if (Var->getIsArg()) { |
| 1057 Lo->setIsArg(); | 1062 Lo->setIsArg(); |
| 1058 Hi->setIsArg(); | 1063 Hi->setIsArg(); |
| 1059 } | 1064 } |
| 1060 } | 1065 } |
| 1061 | 1066 |
| 1062 Operand *TargetX8632::loOperand(Operand *Operand) { | 1067 Operand *TargetX8632::loOperand(Operand *Operand) { |
| 1063 assert(Operand->getType() == IceType_i64); | 1068 assert(Operand->getType() == IceType_i64); |
| 1064 if (Operand->getType() != IceType_i64) | 1069 if (Operand->getType() != IceType_i64) |
| (...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4647 } else if (IsConstant || IsExternal) | 4652 } else if (IsConstant || IsExternal) |
| 4648 Str << "\t.zero\t" << Size << "\n"; | 4653 Str << "\t.zero\t" << Size << "\n"; |
| 4649 // Size is part of .comm. | 4654 // Size is part of .comm. |
| 4650 | 4655 |
| 4651 if (IsConstant || HasNonzeroInitializer || IsExternal) | 4656 if (IsConstant || HasNonzeroInitializer || IsExternal) |
| 4652 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 4657 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
| 4653 // Size is part of .comm. | 4658 // Size is part of .comm. |
| 4654 } | 4659 } |
| 4655 | 4660 |
| 4656 } // end of namespace Ice | 4661 } // end of namespace Ice |
| OLD | NEW |