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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 1273153002: Subzero. Native 64-bit int arithmetic on x86-64. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Removes the x8664-specific xtest target. Created 5 years, 4 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/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 /// \file 10 /// \file
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 emitConstantPool<PoolTypeConverter<double>>(Ctx); 785 emitConstantPool<PoolTypeConverter<double>>(Ctx);
786 } break; 786 } break;
787 } 787 }
788 } 788 }
789 789
790 void TargetDataX8632::lowerJumpTables() { 790 void TargetDataX8632::lowerJumpTables() {
791 switch (Ctx->getFlags().getOutFileType()) { 791 switch (Ctx->getFlags().getOutFileType()) {
792 case FT_Elf: { 792 case FT_Elf: {
793 ELFObjectWriter *Writer = Ctx->getObjectWriter(); 793 ELFObjectWriter *Writer = Ctx->getObjectWriter();
794 for (const JumpTableData &JT : Ctx->getJumpTables()) 794 for (const JumpTableData &JT : Ctx->getJumpTables())
795 Writer->writeJumpTable(JT, llvm::ELF::R_386_32); 795 Writer->writeJumpTable(JT, TargetX8632::Traits::RelFixup);
796 } break; 796 } break;
797 case FT_Asm: 797 case FT_Asm:
798 // Already emitted from Cfg 798 // Already emitted from Cfg
799 break; 799 break;
800 case FT_Iasm: { 800 case FT_Iasm: {
801 if (!BuildDefs::dump()) 801 if (!BuildDefs::dump())
802 return; 802 return;
803 Ostream &Str = Ctx->getStrEmit(); 803 Ostream &Str = Ctx->getStrEmit();
804 for (const JumpTableData &JT : Ctx->getJumpTables()) { 804 for (const JumpTableData &JT : Ctx->getJumpTables()) {
805 Str << "\t.section\t.rodata." << JT.getFunctionName() 805 Str << "\t.section\t.rodata." << JT.getFunctionName()
806 << "$jumptable,\"a\",@progbits\n"; 806 << "$jumptable,\"a\",@progbits\n";
807 Str << "\t.align\t" << typeWidthInBytes(getPointerType()) << "\n"; 807 Str << "\t.align\t" << typeWidthInBytes(getPointerType()) << "\n";
808 Str << InstJumpTable::makeName(JT.getFunctionName(), JT.getId()) << ":"; 808 Str << InstJumpTable::makeName(JT.getFunctionName(), JT.getId()) << ":";
809 809
810 // On X8632 pointers are 32-bit hence the use of .long 810 // On X8632 pointers are 32-bit hence the use of .long
811 for (intptr_t TargetOffset : JT.getTargetOffsets()) 811 for (intptr_t TargetOffset : JT.getTargetOffsets())
812 Str << "\n\t.long\t" << JT.getFunctionName() << "+" << TargetOffset; 812 Str << "\n\t.long\t" << JT.getFunctionName() << "+" << TargetOffset;
813 Str << "\n"; 813 Str << "\n";
814 } 814 }
815 } break; 815 } break;
816 } 816 }
817 } 817 }
818 818
819 void TargetDataX8632::lowerGlobals(const VariableDeclarationList &Vars, 819 void TargetDataX8632::lowerGlobals(const VariableDeclarationList &Vars,
820 const IceString &SectionSuffix) { 820 const IceString &SectionSuffix) {
821 switch (Ctx->getFlags().getOutFileType()) { 821 switch (Ctx->getFlags().getOutFileType()) {
822 case FT_Elf: { 822 case FT_Elf: {
823 ELFObjectWriter *Writer = Ctx->getObjectWriter(); 823 ELFObjectWriter *Writer = Ctx->getObjectWriter();
824 Writer->writeDataSection(Vars, llvm::ELF::R_386_32, SectionSuffix); 824 Writer->writeDataSection(Vars, TargetX8632::Traits::RelFixup,
825 SectionSuffix);
825 } break; 826 } break;
826 case FT_Asm: 827 case FT_Asm:
827 case FT_Iasm: { 828 case FT_Iasm: {
828 const IceString &TranslateOnly = Ctx->getFlags().getTranslateOnly(); 829 const IceString &TranslateOnly = Ctx->getFlags().getTranslateOnly();
829 OstreamLocker L(Ctx); 830 OstreamLocker L(Ctx);
830 for (const VariableDeclaration *Var : Vars) { 831 for (const VariableDeclaration *Var : Vars) {
831 if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) { 832 if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) {
832 emitGlobal(*Var, SectionSuffix); 833 emitGlobal(*Var, SectionSuffix);
833 } 834 }
834 } 835 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 // entries in case the high-level table has extra entries. 942 // entries in case the high-level table has extra entries.
942 #define X(tag, sizeLog2, align, elts, elty, str) \ 943 #define X(tag, sizeLog2, align, elts, elty, str) \
943 static_assert(_table1_##tag == _table2_##tag, \ 944 static_assert(_table1_##tag == _table2_##tag, \
944 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); 945 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE");
945 ICETYPE_TABLE 946 ICETYPE_TABLE
946 #undef X 947 #undef X
947 } // end of namespace dummy3 948 } // end of namespace dummy3
948 } // end of anonymous namespace 949 } // end of anonymous namespace
949 950
950 } // end of namespace Ice 951 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698