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

Side by Side Diff: src/IceTargetLowering.cpp

Issue 1214693004: ARM lowering integer divide and remainder, with div by 0 checks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fill in todo Created 5 years, 5 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
OLDNEW
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===//
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 skeleton of the TargetLowering class, 10 // This file implements the skeleton of the TargetLowering class,
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 Str << "\t.p2align\t" << llvm::Log2_32(Align) << "\n"; 512 Str << "\t.p2align\t" << llvm::Log2_32(Align) << "\n";
513 } 513 }
514 514
515 Str << MangledName << ":\n"; 515 Str << MangledName << ":\n";
516 516
517 if (HasNonzeroInitializer) { 517 if (HasNonzeroInitializer) {
518 for (const std::unique_ptr<VariableDeclaration::Initializer> &Init : 518 for (const std::unique_ptr<VariableDeclaration::Initializer> &Init :
519 Var.getInitializers()) { 519 Var.getInitializers()) {
520 switch (Init->getKind()) { 520 switch (Init->getKind()) {
521 case VariableDeclaration::Initializer::DataInitializerKind: { 521 case VariableDeclaration::Initializer::DataInitializerKind: {
522 const auto &Data = llvm::cast<VariableDeclaration::DataInitializer>( 522 const auto &Data =
523 Init.get())->getContents(); 523 llvm::cast<VariableDeclaration::DataInitializer>(Init.get())
524 ->getContents();
524 for (SizeT i = 0; i < Init->getNumBytes(); ++i) { 525 for (SizeT i = 0; i < Init->getNumBytes(); ++i) {
525 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; 526 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
526 } 527 }
527 break; 528 break;
528 } 529 }
529 case VariableDeclaration::Initializer::ZeroInitializerKind: 530 case VariableDeclaration::Initializer::ZeroInitializerKind:
530 Str << "\t.zero\t" << Init->getNumBytes() << "\n"; 531 Str << "\t.zero\t" << Init->getNumBytes() << "\n";
531 break; 532 break;
532 case VariableDeclaration::Initializer::RelocInitializerKind: { 533 case VariableDeclaration::Initializer::RelocInitializerKind: {
533 const auto *Reloc = 534 const auto *Reloc =
(...skipping 29 matching lines...) Expand all
563 if (Target == Target_##X) \ 564 if (Target == Target_##X) \
564 return TargetHeader##X::create(Ctx); 565 return TargetHeader##X::create(Ctx);
565 #include "llvm/Config/SZTargets.def" 566 #include "llvm/Config/SZTargets.def"
566 567
567 llvm::report_fatal_error("Unsupported target header lowering"); 568 llvm::report_fatal_error("Unsupported target header lowering");
568 } 569 }
569 570
570 TargetHeaderLowering::~TargetHeaderLowering() = default; 571 TargetHeaderLowering::~TargetHeaderLowering() = default;
571 572
572 } // end of namespace Ice 573 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698