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

Side by Side Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2471883005: [SubZero] Generate MIPS.abiflags section (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 1 month 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/IceTargetLoweringMIPS32.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // 1 //
2 // The Subzero Code Generator 2 // The Subzero Code Generator
3 // 3 //
4 // This file is distributed under the University of Illinois Open Source 4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details. 5 // License. See LICENSE.TXT for details.
6 // 6 //
7 //===----------------------------------------------------------------------===// 7 //===----------------------------------------------------------------------===//
8 /// 8 ///
9 /// \file 9 /// \file
10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost 10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost
(...skipping 4964 matching lines...) Expand 10 before | Expand all | Expand 10 after
4975 } 4975 }
4976 4976
4977 void ConstantUndef::emit(GlobalContext *) const { 4977 void ConstantUndef::emit(GlobalContext *) const {
4978 llvm_unreachable("undef value encountered by emitter."); 4978 llvm_unreachable("undef value encountered by emitter.");
4979 } 4979 }
4980 */ 4980 */
4981 4981
4982 TargetDataMIPS32::TargetDataMIPS32(GlobalContext *Ctx) 4982 TargetDataMIPS32::TargetDataMIPS32(GlobalContext *Ctx)
4983 : TargetDataLowering(Ctx) {} 4983 : TargetDataLowering(Ctx) {}
4984 4984
4985 // Generate .MIPS.abiflags section. This section contains a versioned data
4986 // structure with essential information required for loader to determine the
4987 // requirements of the application.
4988 void TargetDataMIPS32::emitTargetRODataSections() {
4989 struct MipsABIFlagsSection Flags;
4990 ELFObjectWriter *Writer = Ctx->getObjectWriter();
4991 const std::string Name = ".MIPS.abiflags";
4992 const llvm::ELF::Elf64_Word ShType = llvm::ELF::SHT_MIPS_ABIFLAGS;
4993 const llvm::ELF::Elf64_Xword ShFlags = llvm::ELF::SHF_ALLOC;
4994 const llvm::ELF::Elf64_Xword ShAddralign = 8;
4995 const llvm::ELF::Elf64_Xword ShEntsize = sizeof(Flags);
4996 Writer->writeTargetRODataSection(
4997 Name, ShType, ShFlags, ShAddralign, ShEntsize,
4998 llvm::StringRef(reinterpret_cast<const char *>(&Flags), sizeof(Flags)));
4999 }
5000
4985 void TargetDataMIPS32::lowerGlobals(const VariableDeclarationList &Vars, 5001 void TargetDataMIPS32::lowerGlobals(const VariableDeclarationList &Vars,
4986 const std::string &SectionSuffix) { 5002 const std::string &SectionSuffix) {
4987 const bool IsPIC = getFlags().getUseNonsfi(); 5003 const bool IsPIC = getFlags().getUseNonsfi();
4988 switch (getFlags().getOutFileType()) { 5004 switch (getFlags().getOutFileType()) {
4989 case FT_Elf: { 5005 case FT_Elf: {
4990 ELFObjectWriter *Writer = Ctx->getObjectWriter(); 5006 ELFObjectWriter *Writer = Ctx->getObjectWriter();
4991 Writer->writeDataSection(Vars, llvm::ELF::R_MIPS_32, SectionSuffix, IsPIC); 5007 Writer->writeDataSection(Vars, llvm::ELF::R_MIPS_32, SectionSuffix, IsPIC);
4992 } break; 5008 } break;
4993 case FT_Asm: 5009 case FT_Asm:
4994 case FT_Iasm: { 5010 case FT_Iasm: {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
5346 Str << "\t.set\t" 5362 Str << "\t.set\t"
5347 << "noat\n"; 5363 << "noat\n";
5348 } 5364 }
5349 5365
5350 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; 5366 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM];
5351 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; 5367 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM];
5352 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; 5368 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM];
5353 5369
5354 } // end of namespace MIPS32 5370 } // end of namespace MIPS32
5355 } // end of namespace Ice 5371 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698