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

Side by Side Diff: src/IceTargetLoweringARM32.cpp

Issue 1197863003: Subzero: Reduce the amount of #ifdef'd code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 years, 6 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
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This file implements the TargetLoweringARM32 class, which consists almost 10 // This file implements the TargetLoweringARM32 class, which consists almost
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } else if (isFloatingType(Ty)) { 445 } else if (isFloatingType(Ty)) {
446 UnimplementedError(Func->getContext()->getFlags()); 446 UnimplementedError(Func->getContext()->getFlags());
447 continue; 447 continue;
448 } else if (Ty == IceType_i64) { 448 } else if (Ty == IceType_i64) {
449 std::pair<int32_t, int32_t> RegPair; 449 std::pair<int32_t, int32_t> RegPair;
450 if (!CC.I64InRegs(&RegPair)) 450 if (!CC.I64InRegs(&RegPair))
451 continue; 451 continue;
452 Variable *RegisterArg = Func->makeVariable(Ty); 452 Variable *RegisterArg = Func->makeVariable(Ty);
453 Variable *RegisterLo = Func->makeVariable(IceType_i32); 453 Variable *RegisterLo = Func->makeVariable(IceType_i32);
454 Variable *RegisterHi = Func->makeVariable(IceType_i32); 454 Variable *RegisterHi = Func->makeVariable(IceType_i32);
455 if (ALLOW_DUMP) { 455 if (BuildDefs::dump()) {
456 RegisterArg->setName(Func, "home_reg:" + Arg->getName(Func)); 456 RegisterArg->setName(Func, "home_reg:" + Arg->getName(Func));
457 RegisterLo->setName(Func, "home_reg_lo:" + Arg->getName(Func)); 457 RegisterLo->setName(Func, "home_reg_lo:" + Arg->getName(Func));
458 RegisterHi->setName(Func, "home_reg_hi:" + Arg->getName(Func)); 458 RegisterHi->setName(Func, "home_reg_hi:" + Arg->getName(Func));
459 } 459 }
460 RegisterLo->setRegNum(RegPair.first); 460 RegisterLo->setRegNum(RegPair.first);
461 RegisterLo->setIsArg(); 461 RegisterLo->setIsArg();
462 RegisterHi->setRegNum(RegPair.second); 462 RegisterHi->setRegNum(RegPair.second);
463 RegisterHi->setIsArg(); 463 RegisterHi->setIsArg();
464 RegisterArg->setLoHi(RegisterLo, RegisterHi); 464 RegisterArg->setLoHi(RegisterLo, RegisterHi);
465 RegisterArg->setIsArg(); 465 RegisterArg->setIsArg();
466 Arg->setIsArg(false); 466 Arg->setIsArg(false);
467 467
468 Args[I] = RegisterArg; 468 Args[I] = RegisterArg;
469 Context.insert(InstAssign::create(Func, Arg, RegisterArg)); 469 Context.insert(InstAssign::create(Func, Arg, RegisterArg));
470 continue; 470 continue;
471 } else { 471 } else {
472 assert(Ty == IceType_i32); 472 assert(Ty == IceType_i32);
473 int32_t RegNum; 473 int32_t RegNum;
474 if (!CC.I32InReg(&RegNum)) 474 if (!CC.I32InReg(&RegNum))
475 continue; 475 continue;
476 Variable *RegisterArg = Func->makeVariable(Ty); 476 Variable *RegisterArg = Func->makeVariable(Ty);
477 if (ALLOW_DUMP) { 477 if (BuildDefs::dump()) {
478 RegisterArg->setName(Func, "home_reg:" + Arg->getName(Func)); 478 RegisterArg->setName(Func, "home_reg:" + Arg->getName(Func));
479 } 479 }
480 RegisterArg->setRegNum(RegNum); 480 RegisterArg->setRegNum(RegNum);
481 RegisterArg->setIsArg(); 481 RegisterArg->setIsArg();
482 Arg->setIsArg(false); 482 Arg->setIsArg(false);
483 483
484 Args[I] = RegisterArg; 484 Args[I] = RegisterArg;
485 Context.insert(InstAssign::create(Func, Arg, RegisterArg)); 485 Context.insert(InstAssign::create(Func, Arg, RegisterArg));
486 } 486 }
487 } 487 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 if (!InRegs) 709 if (!InRegs)
710 finishArgumentLowering(Arg, FramePtr, BasicFrameOffset, InArgsSizeBytes); 710 finishArgumentLowering(Arg, FramePtr, BasicFrameOffset, InArgsSizeBytes);
711 } 711 }
712 712
713 // Fill in stack offsets for locals. 713 // Fill in stack offsets for locals.
714 assignVarStackSlots(SortedSpilledVariables, SpillAreaPaddingBytes, 714 assignVarStackSlots(SortedSpilledVariables, SpillAreaPaddingBytes,
715 SpillAreaSizeBytes, GlobalsAndSubsequentPaddingSize, 715 SpillAreaSizeBytes, GlobalsAndSubsequentPaddingSize,
716 UsesFramePointer); 716 UsesFramePointer);
717 this->HasComputedFrame = true; 717 this->HasComputedFrame = true;
718 718
719 if (ALLOW_DUMP && Func->isVerbose(IceV_Frame)) { 719 if (BuildDefs::dump() && Func->isVerbose(IceV_Frame)) {
720 OstreamLocker L(Func->getContext()); 720 OstreamLocker L(Func->getContext());
721 Ostream &Str = Func->getContext()->getStrDump(); 721 Ostream &Str = Func->getContext()->getStrDump();
722 722
723 Str << "Stack layout:\n"; 723 Str << "Stack layout:\n";
724 uint32_t SPAdjustmentPaddingSize = 724 uint32_t SPAdjustmentPaddingSize =
725 SpillAreaSizeBytes - LocalsSpillAreaSize - 725 SpillAreaSizeBytes - LocalsSpillAreaSize -
726 GlobalsAndSubsequentPaddingSize - SpillAreaPaddingBytes; 726 GlobalsAndSubsequentPaddingSize - SpillAreaPaddingBytes;
727 Str << " in-args = " << InArgsSizeBytes << " bytes\n" 727 Str << " in-args = " << InArgsSizeBytes << " bytes\n"
728 << " preserved registers = " << PreservedRegsSizeBytes << " bytes\n" 728 << " preserved registers = " << PreservedRegsSizeBytes << " bytes\n"
729 << " spill area padding = " << SpillAreaPaddingBytes << " bytes\n" 729 << " spill area padding = " << SpillAreaPaddingBytes << " bytes\n"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 assert(Var->getType() == IceType_i64); 827 assert(Var->getType() == IceType_i64);
828 Variable *Lo = Var->getLo(); 828 Variable *Lo = Var->getLo();
829 Variable *Hi = Var->getHi(); 829 Variable *Hi = Var->getHi();
830 if (Lo) { 830 if (Lo) {
831 assert(Hi); 831 assert(Hi);
832 return; 832 return;
833 } 833 }
834 assert(Hi == nullptr); 834 assert(Hi == nullptr);
835 Lo = Func->makeVariable(IceType_i32); 835 Lo = Func->makeVariable(IceType_i32);
836 Hi = Func->makeVariable(IceType_i32); 836 Hi = Func->makeVariable(IceType_i32);
837 if (ALLOW_DUMP) { 837 if (BuildDefs::dump()) {
838 Lo->setName(Func, Var->getName(Func) + "__lo"); 838 Lo->setName(Func, Var->getName(Func) + "__lo");
839 Hi->setName(Func, Var->getName(Func) + "__hi"); 839 Hi->setName(Func, Var->getName(Func) + "__hi");
840 } 840 }
841 Var->setLoHi(Lo, Hi); 841 Var->setLoHi(Lo, Hi);
842 if (Var->getIsArg()) { 842 if (Var->getIsArg()) {
843 Lo->setIsArg(); 843 Lo->setIsArg();
844 Hi->setIsArg(); 844 Hi->setIsArg();
845 } 845 }
846 } 846 }
847 847
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 2285
2286 void TargetARM32::makeRandomRegisterPermutation( 2286 void TargetARM32::makeRandomRegisterPermutation(
2287 llvm::SmallVectorImpl<int32_t> &Permutation, 2287 llvm::SmallVectorImpl<int32_t> &Permutation,
2288 const llvm::SmallBitVector &ExcludeRegisters) const { 2288 const llvm::SmallBitVector &ExcludeRegisters) const {
2289 (void)Permutation; 2289 (void)Permutation;
2290 (void)ExcludeRegisters; 2290 (void)ExcludeRegisters;
2291 UnimplementedError(Func->getContext()->getFlags()); 2291 UnimplementedError(Func->getContext()->getFlags());
2292 } 2292 }
2293 2293
2294 void TargetARM32::emit(const ConstantInteger32 *C) const { 2294 void TargetARM32::emit(const ConstantInteger32 *C) const {
2295 if (!ALLOW_DUMP) 2295 if (!BuildDefs::dump())
2296 return; 2296 return;
2297 Ostream &Str = Ctx->getStrEmit(); 2297 Ostream &Str = Ctx->getStrEmit();
2298 Str << getConstantPrefix() << C->getValue(); 2298 Str << getConstantPrefix() << C->getValue();
2299 } 2299 }
2300 2300
2301 void TargetARM32::emit(const ConstantInteger64 *) const { 2301 void TargetARM32::emit(const ConstantInteger64 *) const {
2302 llvm::report_fatal_error("Not expecting to emit 64-bit integers"); 2302 llvm::report_fatal_error("Not expecting to emit 64-bit integers");
2303 } 2303 }
2304 2304
2305 void TargetARM32::emit(const ConstantFloat *C) const { 2305 void TargetARM32::emit(const ConstantFloat *C) const {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 << ".eabi_attribute 36, 1 @ Tag_FP_HP_extension\n" 2378 << ".eabi_attribute 36, 1 @ Tag_FP_HP_extension\n"
2379 << ".eabi_attribute 38, 1 @ Tag_ABI_FP_16bit_format\n" 2379 << ".eabi_attribute 38, 1 @ Tag_ABI_FP_16bit_format\n"
2380 << ".eabi_attribute 42, 1 @ Tag_MPextension_use\n" 2380 << ".eabi_attribute 42, 1 @ Tag_MPextension_use\n"
2381 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n"; 2381 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n";
2382 // Technically R9 is used for TLS with Sandboxing, and we reserve it. 2382 // Technically R9 is used for TLS with Sandboxing, and we reserve it.
2383 // However, for compatibility with current NaCl LLVM, don't claim that. 2383 // However, for compatibility with current NaCl LLVM, don't claim that.
2384 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; 2384 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n";
2385 } 2385 }
2386 2386
2387 } // end of namespace Ice 2387 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698