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

Side by Side Diff: src/IceTargetLowering.cpp

Issue 1186713010: Subzero: Add more kinds of RMW lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Refactor the assembler for 8 integer arithmetic instructions 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/IceInstX8632.cpp ('k') | src/IceTargetLoweringX8632.h » ('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/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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // interpret N as bytes, or power of 2 bytes, depending on the target. 510 // interpret N as bytes, or power of 2 bytes, depending on the target.
511 Str << "\t.p2align\t" << llvm::Log2_32(Align) << "\n"; 511 Str << "\t.p2align\t" << llvm::Log2_32(Align) << "\n";
512 } 512 }
513 513
514 Str << MangledName << ":\n"; 514 Str << MangledName << ":\n";
515 515
516 if (HasNonzeroInitializer) { 516 if (HasNonzeroInitializer) {
517 for (VariableDeclaration::Initializer *Init : Var.getInitializers()) { 517 for (VariableDeclaration::Initializer *Init : Var.getInitializers()) {
518 switch (Init->getKind()) { 518 switch (Init->getKind()) {
519 case VariableDeclaration::Initializer::DataInitializerKind: { 519 case VariableDeclaration::Initializer::DataInitializerKind: {
520 const auto &Data = llvm::cast<VariableDeclaration::DataInitializer>( 520 const auto &Data =
521 Init)->getContents(); 521 llvm::cast<VariableDeclaration::DataInitializer>(Init)
522 ->getContents();
522 for (SizeT i = 0; i < Init->getNumBytes(); ++i) { 523 for (SizeT i = 0; i < Init->getNumBytes(); ++i) {
523 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; 524 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
524 } 525 }
525 break; 526 break;
526 } 527 }
527 case VariableDeclaration::Initializer::ZeroInitializerKind: 528 case VariableDeclaration::Initializer::ZeroInitializerKind:
528 Str << "\t.zero\t" << Init->getNumBytes() << "\n"; 529 Str << "\t.zero\t" << Init->getNumBytes() << "\n";
529 break; 530 break;
530 case VariableDeclaration::Initializer::RelocInitializerKind: { 531 case VariableDeclaration::Initializer::RelocInitializerKind: {
531 const auto *Reloc = 532 const auto *Reloc =
(...skipping 29 matching lines...) Expand all
561 if (Target == Target_##X) \ 562 if (Target == Target_##X) \
562 return TargetHeader##X::create(Ctx); 563 return TargetHeader##X::create(Ctx);
563 #include "llvm/Config/SZTargets.def" 564 #include "llvm/Config/SZTargets.def"
564 565
565 llvm::report_fatal_error("Unsupported target header lowering"); 566 llvm::report_fatal_error("Unsupported target header lowering");
566 } 567 }
567 568
568 TargetHeaderLowering::~TargetHeaderLowering() {} 569 TargetHeaderLowering::~TargetHeaderLowering() {}
569 570
570 } // end of namespace Ice 571 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698