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

Side by Side Diff: src/IceTargetLoweringARM32.cpp

Issue 1191573003: Add a basic enum for ARM InstructionSet / cpu features. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: plus begin 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/IceTargetLoweringARM32.h ('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/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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Value is in bytes. Return Value adjusted to the next highest multiple 129 // Value is in bytes. Return Value adjusted to the next highest multiple
130 // of the stack alignment. 130 // of the stack alignment.
131 uint32_t applyStackAlignment(uint32_t Value) { 131 uint32_t applyStackAlignment(uint32_t Value) {
132 return Utils::applyAlignment(Value, ARM32_STACK_ALIGNMENT_BYTES); 132 return Utils::applyAlignment(Value, ARM32_STACK_ALIGNMENT_BYTES);
133 } 133 }
134 134
135 } // end of anonymous namespace 135 } // end of anonymous namespace
136 136
137 TargetARM32::TargetARM32(Cfg *Func) 137 TargetARM32::TargetARM32(Cfg *Func)
138 : TargetLowering(Func), UsesFramePointer(false), NeedsStackAlignment(false), 138 : TargetLowering(Func), InstructionSet(ARM32InstructionSet::Begin),
139 MaybeLeafFunc(true), SpillAreaSizeBytes(0) { 139 UsesFramePointer(false), NeedsStackAlignment(false), MaybeLeafFunc(true),
140 SpillAreaSizeBytes(0) {
141 static_assert(
142 (ARM32InstructionSet::End - ARM32InstructionSet::Begin) ==
143 (TargetInstructionSet::ARM32InstructionSet_End -
144 TargetInstructionSet::ARM32InstructionSet_Begin),
145 "ARM32InstructionSet range different from TargetInstructionSet");
146 if (Func->getContext()->getFlags().getTargetInstructionSet() !=
147 TargetInstructionSet::BaseInstructionSet) {
148 InstructionSet = static_cast<ARM32InstructionSet>(
149 (Func->getContext()->getFlags().getTargetInstructionSet() -
150 TargetInstructionSet::ARM32InstructionSet_Begin) +
151 ARM32InstructionSet::Begin);
152 }
140 // TODO: Don't initialize IntegerRegisters and friends every time. 153 // TODO: Don't initialize IntegerRegisters and friends every time.
141 // Instead, initialize in some sort of static initializer for the 154 // Instead, initialize in some sort of static initializer for the
142 // class. 155 // class.
143 llvm::SmallBitVector IntegerRegisters(RegARM32::Reg_NUM); 156 llvm::SmallBitVector IntegerRegisters(RegARM32::Reg_NUM);
144 llvm::SmallBitVector FloatRegisters(RegARM32::Reg_NUM); 157 llvm::SmallBitVector FloatRegisters(RegARM32::Reg_NUM);
145 llvm::SmallBitVector VectorRegisters(RegARM32::Reg_NUM); 158 llvm::SmallBitVector VectorRegisters(RegARM32::Reg_NUM);
146 llvm::SmallBitVector InvalidRegisters(RegARM32::Reg_NUM); 159 llvm::SmallBitVector InvalidRegisters(RegARM32::Reg_NUM);
147 ScratchRegs.resize(RegARM32::Reg_NUM); 160 ScratchRegs.resize(RegARM32::Reg_NUM);
148 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ 161 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \
149 isFP) \ 162 isFP) \
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2253 << ".eabi_attribute 36, 1 @ Tag_FP_HP_extension\n" 2266 << ".eabi_attribute 36, 1 @ Tag_FP_HP_extension\n"
2254 << ".eabi_attribute 38, 1 @ Tag_ABI_FP_16bit_format\n" 2267 << ".eabi_attribute 38, 1 @ Tag_ABI_FP_16bit_format\n"
2255 << ".eabi_attribute 42, 1 @ Tag_MPextension_use\n" 2268 << ".eabi_attribute 42, 1 @ Tag_MPextension_use\n"
2256 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n"; 2269 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n";
2257 // Technically R9 is used for TLS with Sandboxing, and we reserve it. 2270 // Technically R9 is used for TLS with Sandboxing, and we reserve it.
2258 // However, for compatibility with current NaCl LLVM, don't claim that. 2271 // However, for compatibility with current NaCl LLVM, don't claim that.
2259 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; 2272 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n";
2260 } 2273 }
2261 2274
2262 } // end of namespace Ice 2275 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringARM32.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698